Encoding/decoding method for video signal and device therefor

ABSTRACT

Embodiments of the present invention provide a video signal processing method and device. Particularly, a method for decoding a video signal, may comprise the steps of: checking whether a transfer skip is applied to a current block; obtaining, from a video signal, a transform index for indicating a transform type set applied to the current block when the transform skip is not applied to the current block, wherein the transform type set includes transform types applied to the current block in horizontal and vertical directions; checking whether the transform type set includes DCT2; determining a region to which a primary transform is applied based on a checking result; and performing an inverse transform on the region to which the primary transform is applied in the horizontal and vertical directions using the transform types included in the transform type set.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. application Ser. No.17/282,120, filed on Apr. 1, 2021, which is a National Stage filingunder 35 U.S.C. 371 of International Application No. PCT/KR2019/012840,filed on Oct. 1, 2019, which claims the benefit of U.S. ProvisionalApplication No. 62/739,800, filed on Oct. 1, 2018, the contents of whichare all hereby incorporated by reference herein in their entirety.

TECHNICAL FIELD

Embodiments of the present disclosure relate to a method and anapparatus for processing video signals and, more specifically, to amethod and an apparatus for encoding/decoding video signals byperforming a transform based on reduced transform.

BACKGROUND ART

Compression coding refers to a signal processing technique fortransmitting digitalized information through a communication line orstoring the same in an appropriate form in a storage medium. Media suchas video, images and audio can be objects of compression coding and,particularly, a technique of performing compression coding on images iscalled video image compression.

Next-generation video content will have features of a high spatialresolution, a high frame rate and high dimensionality of scenerepresentation. To process such content, memory storage, a memory accessrate and processing power will significantly increase.

Therefore, it is necessary to design a coding tool for processingnext-generation video content more efficiently. Particularly, videocodec standards after the high efficiency video coding (HEVC) standardrequire an efficient transform technique for transforming a spatialdomain video signal into a frequency domain signal along with aprediction technique with higher accuracy.

DISCLOSURE Technical Problem

An object of embodiments of the present disclosure is to provide amethod for performing primary transform on a predefined region accordingto specific conditions.

Technical objects to be achieved by the present disclosure are notlimited to the aforementioned technical objects, and other technicalobjects not described above may be evidently understood by a personhaving ordinary skill in the art to which the present disclosurepertains from the following description.

Technical Solution

In one aspect of embodiments of the present disclosure, a method fordecoding a video signal may include: checking whether a transform skipis applied to a current block; obtaining, from the video signal, atransform index indicating a transform type set applied to the currentblock when the transform skip is not applied to the current block,wherein the transform type set includes transform types applied to thecurrent block in horizontal and vertical directions; checking whetherthe transform type set includes DCT2; determining a region to which aprimary transform is applied based on a checking result; and performingan inverse transform on the region to which the primary transform isapplied in the horizontal and vertical directions using the transformtypes included in the transform type set.

Preferably, the method may further include deriving coefficients of aregion other than the region to which the primary transform is appliedas 0 within the current block.

Preferably, when the transform type set includes DCT2, a width of theregion to which the primary transform is applied may be determined as asmaller value between a width of the current block and 32 and a heightof the region to which the primary transform is applied may bedetermined as a smaller value between a height of the current block and32.

Preferably, when the transform type set is any one of a plurality oftransform type sets including combinations of DST7 and/or DCT8, thewidth of the region to which the primary transform is applied may bedetermined as a smaller value between the width of the current block and16 and the height of the region to which the primary transform isapplied may be determined as a smaller value between the height of thecurrent block and 16.

Preferably, the method may further include obtaining a syntax elementindicating a position of a last significant coefficient in scan orderwithin the current block, wherein coefficients to which the inversetransform is applied may be obtained from the video signal based on theposition of the last significant coefficient.

Preferably, the syntax element may be binarized according to a truncatedunary method, and a maximum length of code for the syntax element may bedetermined based on the region derived as 0.

In another aspect of embodiments of the present disclosure, an apparatusfor decoding a video signal may include: a memory configured to storethe video signal; and a processor connected to the memory, wherein theprocessor may be configured to: check whether a transform skip isapplied to a current block; obtain, from the video signal, a transformindex indicating a transform type set applied to the current block whenthe transform skip is not applied to the current block, wherein thetransform type set includes transform types applied to the current blockin horizontal and vertical directions; check whether the transform typeset includes DCT2; determine a region to which a primary transform isapplied based on a checking result; and perform an inverse transform onthe region to which the primary transform is applied in the horizontaland vertical directions using the transform types included in thetransform type set.

Advantageous Effects

According to embodiments of the present disclosure, it is possible toconsiderably reduce complexity by performing a transform only on apredefined region according to specific conditions.

Effects which may be obtained by the present disclosure are not limitedto the aforementioned effects, and other technical effects not describedabove may be evidently understood by a person having ordinary skill inthe art to which the present disclosure pertains from the followingdescription.

DESCRIPTION OF DRAWINGS

The accompanying drawings, which are included herein as a part of thedescription for help understanding the present disclosure, provideembodiments of the present disclosure, and describe the technicalfeatures of the present disclosure with the description below.

FIG. 1 shows an example of a video coding system as an embodiment towhich the present disclosure is applied.

FIG. 2 is a schematic block diagram of an encoding apparatus whichencodes video/image signals as an embodiment to which the presentdisclosure is applied.

FIG. 3 is a schematic block diagram of a decoding apparatus whichdecodes image signals as an embodiment to which the present disclosureis applied.

FIG. 4 is a configuration diagram of a content streaming system anembodiment to which the present disclosure is applied.

FIG. 5 shows embodiments to which the present disclosure is applicable,FIG. 5A is a diagram for describing a block segmentation structureaccording to QT (Quad Tree), FIG. 5B is a diagram for describing a blocksegmentation structure according to BT (Binary Tree), FIG. 5C is adiagram for describing a block segmentation structure according to TT(Ternary Tree), and FIG. 5D is a diagram for describing a blocksegmentation structure according to AT (Asymmetric Tree).

FIGS. 6 and 7 show embodiments to which the present disclosure isapplied, FIG. 6 is a schematic block diagram of a transform andquantization unit, and an inverse quantization and inverse transformunit in an encoding apparatus and FIG. 7 is a schematic block diagram ofan inverse quantization and inverse transform unit in a decodingapparatus.

FIG. 8 is a flowchart showing a process in which adaptive multipletransform (AMT) is performed.

FIG. 9 is a flowchart showing a decoding process in which AMT isperformed.

FIG. 10 is a flowchart showing an inverse transform process on the basisof MTS according to an embodiment of the present disclosure.

FIG. 11 is a block diagram of an apparatus for performing decoding onthe basis of MTS according to an embodiment of the present disclosure.

FIGS. 12 and 13 are flowcharts showing encoding/decoding to whichsecondary transform is applied as an embodiment to which presentdisclosure is applied.

FIGS. 14 and 15 show an embodiment to which the present disclosure isapplied, FIG. 14 is a diagram for describing Givens rotation and FIG. 15shows a configuration of one round in 4×4 non-separable secondarytransform (NSST) composed of Givens rotation layers and permutations.

FIG. 16 shows operation of reduced secondary transform (RST) as anembodiment to which the present disclosure is applied.

FIG. 17 is a diagram showing a process of performing reverse scanningfrom the sixty-fourth coefficient to the seventeenth coefficient inreverse scan order as an embodiment to which the present disclosure isapplied.

FIG. 18 is an exemplary flowchart showing encoding using a singletransform indicator (STI) as an embodiment to which the presentdisclosure is applied.

FIG. 19 is an exemplary flowchart showing encoding using a unifiedtransform indicator (UTI) as an embodiment to which the presentdisclosure is applied.

FIG. 20A and FIG. 20B illustrate two exemplary flowcharts showingencoding using a UTI as an embodiment to which the present disclosure isapplied.

FIG. 21 is an exemplary flowchart showing encoding for performingtransform as an embodiment to which the present disclosure is applied.

FIG. 22 is an exemplary flowchart showing decoding for performingtransform as an embodiment to which the present disclosure is applied.

FIG. 23 is a detailed block diagram showing an example of a transformunit 120 in an encoding apparatus 100 as an embodiment to which thepresent disclosure is applied.

FIG. 24 is a detailed block diagram showing an example of an inversetransform unit 230 in a decoding apparatus 200 as an embodiment to whichthe present disclosure is applied.

FIG. 25 is a flowchart for processing a video signal as an embodiment towhich the present disclosure is applied.

FIG. 26 is a flow chart illustrating a method for transforming a videosignal according to an embodiment to which the present disclosure isapplied.

FIG. 27 is a diagram illustrating a method for encoding a video signalusing reduced transform as an embodiment to which the present disclosureis applied.

FIG. 28 is a diagram illustrating a method for decoding a video signalusing reduced transform as an embodiment to which the present disclosureis applied.

FIG. 29 is a flowchart illustrating a method for decoding a video signalbased on reduced transform according to an embodiment of the presentdisclosure.

FIG. 30 is a flowchart illustrating a method for decoding a video signalaccording to an embodiment of the present disclosure.

FIG. 31 is an exemplary block diagram of an apparatus for processing avideo signal as an embodiment to which the present disclosure isapplied.

FIG. 32 is a flowchart illustrating a design of forward DST7 with alength of 16 using discrete Fourier transform (DFT) as an embodiment towhich the present disclosure is applied.

FIG. 33 is a flowchart illustrating a design of inverse DST7 with alength of 16 using discrete Fourier transform (DFT) as an embodiment towhich the present disclosure is applied.

FIGS. 34 to 36 are flowcharts illustrating application of xDST7_FFT_B16of FIGS. 15 and 16 as an embodiment to which the present disclosure isapplied.

FIG. 37 is a flowchart illustrating a design of forward DST7 with alength of 32 using discrete Fourier transform (DFT) as an embodiment towhich the present disclosure is applied.

FIG. 38 is a flowchart illustrating a design of inverse DST7 with alength of 32 using discrete Fourier transform (DFT) as an embodiment towhich the present disclosure is applied.

FIGS. 39 to 41 are flowcharts illustrating application of xDST7_FFT_B16of FIGS. 15 and 16 as an embodiment to which the present disclosure isapplied.

FIG. 42 is a flowchart illustrating a design of forward DST7 with alength of 8 using discrete Fourier transform (DFT) as an embodiment towhich the present disclosure is applied.

FIG. 43 is a flowchart illustrating a design of inverse DST7 with alength of 8 using discrete Fourier transform (DFT) as an embodiment towhich the present disclosure is applied.

FIG. 44 is a block diagram illustrating 16×16 DST7 to which 33-point DFTis applied as an embodiment to which the present disclosure is applied.1551 FIG. 45 is a block diagram illustrating 32×32 DST7 to which65-point DFT is applied as an embodiment to which the present disclosureis applied.

FIG. 46 is a flowchart illustrating encoding of performing forwarddiscrete sine transform-7 (DST7) and forward discrete cosine transform-8(DCT8) through discrete Fourier transform (DFT) as an embodiment towhich the present disclosure is applied.

FIG. 47 is a flowchart illustrating decoding of performing inversediscrete sine transform-7 (DST7) and inverse discrete cosine transform-8(DCT8) through discrete Fourier transform (DFT) as an embodiment towhich the present disclosure is applied.

MODE FOR DISCLOSURE

Some embodiments of the present disclosure are described in detail withreference to the accompanying drawings. A detailed description to bedisclosed along with the accompanying drawings are intended to describesome embodiments of the present disclosure and are not intended todescribe a sole embodiment of the present disclosure. The followingdetailed description includes more details in order to provide fullunderstanding of the present disclosure. However, those skilled in theart will understand that the present disclosure may be implementedwithout such more details.

In some cases, in order to avoid that the concept of the presentdisclosure becomes vague, known structures and devices are omitted ormay be shown in a block diagram form based on the core functions of eachstructure and device.

Although most terms used in the present disclosure have been selectedfrom general ones widely used in the art, some terms have beenarbitrarily selected by the applicant and their meanings are explainedin detail in the following description as needed. Thus, the presentdisclosure should be understood with the intended meanings of the termsrather than their simple names or meanings.

Specific terms used in the following description have been provided tohelp understanding of the present disclosure, and the use of suchspecific terms may be changed in various forms without departing fromthe technical sprit of the present disclosure. For example, signals,data, samples, pictures, frames, blocks and the like may beappropriately replaced and interpreted in each coding process.

In the present description, a “processing unit” refers to a unit inwhich an encoding/decoding process such as prediction, transform and/orquantization is performed. Further, the processing unit may beinterpreted into the meaning including a unit for a luma component and aunit for a chroma component. For example, the processing unit maycorrespond to a block, a coding unit (CU), a prediction unit (PU) or atransform unit (TU).

In addition, the processing unit may be interpreted into a unit for aluma component or a unit for a chroma component. For example, theprocessing unit may correspond to a coding tree block (CTB), a codingblock (CB), a PU or a transform block (TB) for the luma component.Further, the processing unit may correspond to a CTB, a CB, a PU or a TBfor the chroma component. Moreover, the processing unit is not limitedthereto and may be interpreted into the meaning including a unit for theluma component and a unit for the chroma component.

In addition, the processing unit is not necessarily limited to a squareblock and may be configured as a polygonal shape having three or morevertexes.

Furthermore, in the present description, a pixel is called a sample. Inaddition, using a sample may mean using a pixel value or the like.

FIG. 1 shows an example of a video coding system as an embodiment towhich the present disclosure is applied.

The video coding system may include a source device 10 and a receivedevice 20. The source device 10 can transmit encoded video/imageinformation or data to the receive device 20 in the form of a file orstreaming through a digital storage medium or a network.

The source device 10 may include a video source 11, an encodingapparatus 12, and a transmitter 13. The receive device 20 may include areceiver, a decoding apparatus 22 and a renderer 23. The encodingapparatus 12 may be called a video/image encoding apparatus and thedecoding apparatus 20 may be called a video/image decoding apparatus.The transmitter 13 may be included in the encoding apparatus 12. Thereceiver 21 may be included in the decoding apparatus 22. The renderer23 may include a display and the display may be configured as a separatedevice or an external component.

The video source can acquire a video/image through video/imagecapturing, combining or generating process. The video source may includea video/image capture device and/or a video/image generation device. Thevideo/image capture device may include, for example, one or morecameras, a video/image archive including previously capturedvideos/images, and the like. The video/image generation device mayinclude, for example, a computer, a tablet, a smartphone, and the likeand (electronically) generate a video/image. For example, a virtualvideo/image can be generated through a computer or the like and, in thiscase, a video/image capture process may be replaced with a related datageneration process.

The encoding apparatus 12 can encode an input video/image. The encodingapparatus 12 can perform a series of procedures such as prediction,transform and quantization for compression and coding efficiency.Encoded data (encoded video/image information) can be output in the formof a bitstream.

The transmitter 13 can transmit encoded video/image information or dataoutput in the form of a bitstream to the receiver of the receive devicein the form of a file or streaming through a digital storage medium or anetwork. The digital storage medium may include various storage mediasuch as a USB, an SD, a CD, a DVD, Blueray, an HDD, and an SSD. Thetransmitter 13 may include an element for generating a media filethrough a predetermined file format and an element for transmissionthrough a broadcast/communication network. The receiver 21 can extract abitstream and transmit the bitstream to the decoding apparatus 22.

The decoding apparatus 22 can decode a video/image by performing aseries of procedures such as inverse quantization, inverse transform andprediction corresponding to operation of the encoding apparatus 12.

The renderer 23 can render the decoded video/image. The renderedvideo/image can be display through a display.

FIG. 2 is a schematic block diagram of an encoding apparatus whichencodes a video/image signal as an embodiment to which the presentdisclosure is applied. The encoding apparatus 100 may correspond to theencoding apparatus 12 of FIG. 1 .

An image partitioning unit 110 can divide an input image (or a pictureor a frame) input to the encoding apparatus 100 into one or moreprocessing units. For example, the processing unit may be called acoding unit (CU). In this case, the coding unit can be recursivelysegmented from a coding tree unit (CTU) or a largest coding unit (LCU)according to a quad-tree binary-tree (QTBT) structure. For example, asingle coding unit can be segmented into a plurality of coding unitswith a deeper depth on the basis of the quad-tree structure and/or thebinary tree structure. In this case, the quad-tree structure may beapplied first and then the binary tree structure may be applied.Alternatively, the binary tree structure may be applied first. A codingprocedure according to the present disclosure can be performed on thebasis of a final coding unit that is no longer segmented. In this case,a largest coding unit may be directly used as the final coding unit orthe coding unit may be recursively segmented into coding units with adeeper depth and a coding unit having an optimal size may be used as thefinal coding unit as necessary on the basis of coding efficiencyaccording to image characteristics. Here, the coding procedure mayinclude procedures such as prediction, transform and reconstructionwhich will be described later. Alternatively, the processing unit mayfurther include a prediction unit (PU) or a transform unit (TU). In thiscase, the prediction unit and the transform unit can be segmented orpartitioned from the aforementioned final coding unit. The predictionunit may be a unit of sample prediction and the transform unit may be aunit of deriving a transform coefficient and/or a unit of deriving aresidual signal from a transform coefficient.

A unit may be interchangeably used with the term “block” or “area”.Generally, an M×N block represents a set of samples or transformcoefficients in M columns and N rows. A sample can generally represent apixel or a pixel value and may represent only a pixel/pixel value of aluma component or only a pixel/pixel value of a chroma component. Thesample can be used as a term corresponding to a picture (image), a pixelor a pel.

The encoding apparatus 100 may generate a residual signal (a residualblock or a residual sample array) by subtracting a predicted signal (apredicted block or a predicted sample array) output from aninter-prediction unit 180 or an intra-prediction unit 185 from an inputvideo signal (an original block or an original sample array), and thegenerated residual signal is transmitted to the transform unit 120. Inthis case, a unit which subtracts the predicted signal (predicted blockor predicted sample array) from the input video signal (original blockor original sample array) in the encoder 100 may be called a subtractor115, as shown. A predictor can perform prediction on a processing targetblock (hereinafter referred to as a current block) and generate apredicted block including predicted samples with respect to the currentblock. The predictor can determine whether intra-prediction orinter-prediction is applied to the current block or units of CU. Thepredictor can generate various types of information about prediction,such as prediction mode information, and transmit the information to anentropy encoding unit 190 as described later in description of eachprediction mode. Information about prediction can be encoded in theentropy encoding unit 190 and output in the form of a bitstream.

The intra-prediction unit 185 can predict a current block with referenceto samples in a current picture. Referred samples may neighbor thecurrent block or may be separated therefrom according to a predictionmode. In intra-prediction, prediction modes may include a plurality ofnondirectional modes and a plurality of directional modes. Thenondirectional modes may include a DC mode and a planar mode, forexample. The directional modes may include, for example, 33 directionalprediction modes or 65 directional prediction modes according to adegree of minuteness of prediction direction. However, this is exemplaryand a number of directional prediction modes equal to or greater than 65or equal to or less than 33 may be used according to settings. Theintra-prediction unit 185 may determine a prediction mode to be appliedto the current block using a prediction mode applied to neighbor blocks.

The inter-prediction unit 180 can derive a predicted block with respectto the current block on the basis of a reference block (reference samplearray) specified by a motion vector on a reference picture. Here, toreduce the quantity of motion information transmitted in aninter-prediction mode, motion information can be predicted in units ofblock, subblock or sample on the basis of correlation of motioninformation between a neighboring block and the current block. Themotion information may include a motion vector and a reference pictureindex. The motion information may further include inter-predictiondirection (L0 prediction, L1 prediction, Bi prediction, etc.)information. In the case of inter-prediction, neighboring blocks mayinclude a spatial neighboring block present in a current picture and atemporal neighboring block present in a reference picture. The referencepicture including the reference block may be the same as or differentfrom the reference picture including the temporal neighboring block. Thetemporal neighboring block may be called a collocated reference block ora collocated CU (colCU) and the reference picture including the temporalneighboring block may be called a collocated picture (colPic). Forexample, the inter-prediction unit 180 may form a motion informationcandidate list on the basis of neighboring blocks and generateinformation indicating which candidate is used to derive a motion vectorand/or a reference picture index of the current block. Inter-predictioncan be performed on the basis of various prediction modes, and in thecase of a skip mode and a merge mode, the inter-prediction unit 180 canuse motion information of a neighboring block as motion information ofthe current block. In the case of the skip mode, a residual signal maynot be transmitted differently from the merge mode. In the case of amotion vector prediction (MVP) mode, the motion vector of the currentblock can be indicated by using a motion vector of a neighboring blockas a motion vector predictor and signaling a motion vector difference.

A predicted signal generated through the inter-prediction unit 180 orthe intra-prediction unit 185 can be used to generate a reconstructedsignal or a residual signal.

The transform unit 120 can generate transform coefficients by applying atransform technique to a residual signal. For example, the transformtechnique may include at least one of DCT (Discrete Cosine Transform),DST (Discrete Sine Transform), KLT (Karhunen-Loeve Transform), GBT(Graph-Based Transform) and CNT (Conditionally Non-linear Transform).Here, GBT refers to transform obtained from a graph representinginformation on relationship between pixels. CNT refers to transformobtained on the basis of a predicted signal generated using allpreviously reconstructed pixels. Further, the transform process may beapplied to square pixel blocks having the same size or applied tonon-square blocks having variable sizes.

A quantization unit 130 may quantize transform coefficients and transmitthe quantized transform coefficients to the entropy encoding unit 190,and the entropy encoding unit 190 may encode a quantized signal(information about the quantized transform coefficients) and output theencoded signal as a bitstream. The information about the quantizedtransform coefficients may be called residual information. Thequantization unit 130 may rearrange the quantized transform coefficientsin the form of a block into the form of a one-dimensional vector on thebasis of a coefficient scan order and generate information about thequantized transform coefficients on the basis of the quantized transformcoefficients in the form of a one-dimensional vector. The entropyencoding unit 190 can execute various encoding methods such asexponential Golomb, CAVLC (context-adaptive variable length coding) andCABAC (context-adaptive binary arithmetic coding), for example. Theentropy encoding unit 190 may encode information necessary forvideo/image reconstruction (e.g., values of syntax elements and thelike) along with or separately from the quantized transformcoefficients. Encoded information (e.g., video/image information) may betransmitted or stored in the form of a bitstream in network abstractionlayer (NAL) unit. The bitstream may be transmitted through a network orstored in a digital storage medium. Here, the network may include abroadcast network and/or a communication network and the digital storagemedium may include various storage media such as a USB, an SD, a CD, aDVD, Blueray, an HDD and an SSD. A transmitter (not shown) whichtransmits the signal output from the entropy encoding unit 190 and/or astorage (not shown) which stores the signal may be configured asintemalhexternal elements of the encoding apparatus 100, and thetransmitter may be a component of the entropy encoding unit 190.

The quantized transform coefficients output from the quantization unit130 can be used to generate a predicted signal. For example, a residualsignal can be reconstructed by applying inverse quantization and inversetransform to the quantized transform coefficients through an inversequantization unit 140 and an inverse transform unit 150 in the loop. Anadder 155 can add the reconstructed residual signal to the predictedsignal output from the inter-prediction unit 180 or the intra-predictionunit 185 such that a reconstructed signal (reconstructed picture,reconstructed block or reconstructed sample array) can be generated.When there is no residual with respect to a processing target block asin a case in which the skip mode is applied, a predicted block can beused as a reconstructed block. The adder 155 may also be called areconstruction unit or a reconstructed block generator. The generatedreconstructed signal can be used for intra-prediction of the nextprocessing target block in the current picture or used forinter-prediction of the next picture through filtering which will bedescribed later.

A filtering unit 160 can improve subjective/objective picture quality byapplying filtering to the reconstructed signal. For example, thefiltering unit 160 can generate a modified reconstructed picture byapplying various filtering methods to the reconstructed picture andtransmit the modified reconstructed picture to a decoded picture buffer170. The various filtering methods may include, for example, deblockingfiltering, sample adaptive offset, adaptive loop filtering, andbilateral filtering. The filtering unit 160 can generate various typesof information about filtering and transmit the information to theentropy encoding unit 190 as will be described later in description ofeach filtering method. Information about filtering may be encoded in theentropy encoding unit 190 and output in the form of a bitstream.

The modified reconstructed picture transmitted to the decoded picturebuffer 170 can be used as a reference picture in the inter-predictionunit 180. Accordingly, the encoding apparatus can avoid mismatch betweenthe encoding apparatus 100 and the decoding apparatus and improveencoding efficiency when inter-prediction is applied.

The decoded picture buffer 170 can store the modified reconstructedpicture such that the modified reconstructed picture is used as areference picture in the inter-prediction unit 180.

FIG. 3 is a schematic block diagram of a decoding apparatus whichperforms decoding of a video signal as an embodiment to which thepresent disclosure is applied. The decoding apparatus 200 of FIG. 3corresponds to the decoding apparatus 22 of FIG. 1 .

Referring to FIG. 3 , the decoding apparatus 200 may include an entropydecoding unit 210, an inverse quantization unit 220, an inversetransform unit 230, an adder 235, a filtering unit 240, a decodedpicture buffer (DPB) 250, an inter-prediction unit 260, and anintra-prediction unit 265. The inter-prediction unit 260 and theintra-prediction unit 265 may be collectively called a predictor. Thatis, the predictor can include the inter-prediction unit 180 and theintra-prediction unit 185. The inverse quantization unit 220 and theinverse transform unit 230 may be collectively called a residualprocessor. That is, the residual processor can include the inversequantization unit 220 and the inverse transform unit 230. Theaforementioned entropy decoding unit 210, inverse quantization unit 220,inverse transform unit 230, adder 235, filtering unit 240,inter-prediction unit 260 and intra-prediction unit 265 may beconfigured as a single hardware component (e.g., a decoder or aprocessor) according to an embodiment. Further, the decoded picturebuffer 250 may be configured as a single hardware component (e.g., amemory or a digital storage medium) according to an embodiment.

When a bitstream including video/image information is input, thedecoding apparatus 200 can reconstruct an image through a processcorresponding to the process of processing the video/image informationin the encoding apparatus 100 of FIG. 2 . For example, the decodingapparatus 200 can perform decoding using a processing unit applied inthe encoding apparatus 100. Accordingly, a processing unit of decodingmay be a coding unit, for example, and the coding unit can be segmentedfrom a coding tree unit or a largest coding unit according to a quadtree structure and/or a binary tree structure. In addition, areconstructed video signal decoded and output by the decoding apparatus200 can be reproduced through a reproduction apparatus.

The decoding apparatus 200 can receive a signal output from the encodingapparatus 100 of FIG. 2 in the form of a bitstream, and the receivedsignal can be decoded through the entropy decoding unit 210. Forexample, the entropy decoding unit 210 can parse the bitstream to deriveinformation (e.g., video/image information) necessary for imagereconstruction (or picture reconstruction). For example, the entropydecoding unit 210 can decode information in the bitstream on the basisof a coding method such as exponential Golomb, CAVLC or CABAC and outputsyntax element values necessary for image reconstruction and quantizedvalues of transform coefficients with respect to residual. Morespecifically, the CABAC entropy decoding method receives a bincorresponding to each syntax element in the bitstream, determines acontext model using decoding target syntax element information anddecoding information of neighboring and decoding target blocks orinformation on symbols/bins decoded in a previous stage, predicts bingeneration probability according to the determined context model andperforms arithmetic decoding of bins to generate a symbol correspondingto each syntax element value. Here, the CABAC entropy decoding methodcan update the context model using information on symbols/bins decodedfor the next symbol/bin context model after the context model isdetermined. Information about prediction among the information decodedin the entropy decoding unit 210 can be provided to the predictor(inter-prediction unit 260 and the intra-prediction unit 265) andresidual values on which entropy decoding has been performed in theentropy decoding unit 210, that is, quantized transform coefficients,and related parameter information can be input to the inversequantization unit 220. Further, information about filtering among theinformation decoded in the entropy decoding unit 210 can be provided tothe filtering unit 240. Meanwhile, a receiver (not shown) which receivesa signal output from the encoding apparatus 100 may be additionallyconfigured as an internal/external element of the decoding apparatus 200or the receiver may be a component of the entropy decoding unit 210.

The inverse quantization unit 220 can inversely quantize the quantizedtransform coefficients to output transform coefficients. The inversequantization unit 220 can rearrange the quantized transform coefficientsin the form of a two-dimensional block. In this case, rearrangement canbe performed on the basis of the coefficient scan order in the encodingapparatus 100. The inverse quantization unit 220 can perform inversequantization on the quantized transform coefficients using aquantization parameter (e.g., quantization step size information) andacquire transform coefficients.

The inverse transform unit 230 inversely transforms the transformcoefficients to obtain a residual signal (residual block or residualsample array).

The predictor can perform prediction on a current block and generate apredicted block including predicted samples with respect to the currentblock. The predictor can determine whether intra-prediction orinter-prediction is applied to the current block on the basis of theinformation about prediction output from the entropy decoding unit 210and determine a specific intra/inter-prediction mode.

The intra-prediction unit 265 can predict the current block withreference to samples in a current picture. The referred samples mayneighbor the current block or may be separated from the current blockaccording to a prediction mode. In intra-prediction, prediction modesmay include a plurality of nondirectional modes and a plurality ofdirectional modes. The intra-prediction 265 may determine a predictionmode applied to the current block using a prediction mode applied toneighboring blocks.

The inter-prediction unit 260 can derive a predicted block with respectto the current block on the basis of a reference block (reference samplearray) specified by a motion vector on a reference picture. Here, toreduce the amount of motion information transmitted in theinter-prediction mode, the motion information can be predicted in unitsof block, subblock or sample on the basis of correlation of the motioninformation between a neighboring block and the current block. Themotion information may include a motion vector and a reference pictureindex. The motion information may further include inter-predictiondirection (L0 prediction, L1 prediction, Bi prediction, etc.)information. In the case of inter-prediction, neighboring blocks mayinclude a spatial neighboring block present in a current picture and atemporal neighboring block present in a reference picture. For example,the inter-prediction unit 260 may form a motion information candidatelist on the basis of neighboring blocks and derive the motion vectorand/or the reference picture index of the current block on the basis ofreceived candidate selection information. Inter-prediction can beperformed on the basis of various prediction modes and the informationabout prediction may include information indicating the inter-predictionmode for the current block.

The adder 235 can generate a reconstructed signal (reconstructedpicture, reconstructed block or reconstructed sample array) by addingthe obtained residual signal to the predicted signal (predicted block orpredicted sample array) output from the inter-prediction unit 260 or theintra-prediction unit 265. When there is no residual with respect to theprocessing target block as in a case in which the skip mode is applied,the predicted block may be used as a reconstructed block.

The adder 235 may also be called a reconstruction unit or areconstructed block generator. The generated reconstructed signal can beused for intra-prediction of the next processing target block in thecurrent picture or used for inter-prediction of the next picture throughfiltering which will be described later.

The filtering unit 240 can improve subjective/objective picture qualityby applying filtering to the reconstructed signal. For example, thefiltering unit 240 can generate a modified reconstructed picture byapplying various filtering methods to the reconstructed picture andtransmit the modified reconstructed picture to a decoded picture buffer250. The various filtering methods may include, for example, deblockingfiltering, sample adaptive offset (SAO), adaptive loop filtering (ALF),and bilateral filtering.

The modified reconstructed picture transmitted to the decoded picturebuffer 250 can be used as a reference picture by the inter-predictionunit 260.

In the present description, embodiments described in the filtering unit160, the inter-prediction unit 180 and the intra-prediction unit 185 ofthe encoding apparatus 100 can be applied to the filtering unit 240, theinter-prediction unit 260 and the intra-prediction unit 265 of thedecoding apparatus equally or in a corresponding manner.

FIG. 4 is a configuration diagram of a content streaming system as anembodiment to which the present disclosure is applied.

The content streaming system to which the present disclosure is appliedmay include an encoding server 410, a streaming server 420, a web server430, a media storage 440, a user equipment 450, and multimedia inputdevices 460.

The encoding server 410 serves to compress content input from multimediainput devices such as a smartphone, a camera and a camcorder intodigital data to generate a bitstream and transmit the bitstream to thestreaming server 420. As another example, when the multimedia inputdevices 460 such as a smartphone, a camera and a camcorder directlygenerate bitstreams, the encoding server 410 may be omitted.

The bitstream may be generated by an encoding method or a bitstreamgeneration method to which the present disclosure is applied and thestreaming server 420 can temporarily store the bitstream in the processof transmitting or receiving the bitstream.

The streaming server 420 transmits multimedia data to the user equipment450 on the basis of a user request through the web server 430 and theweb server 430 serves as a medium that informs a user of services. Whenthe user sends a request for a desired service to the web server 430,the web server 430 delivers the request to the streaming server 420 andthe streaming server 420 transmits multimedia data to the user. Here,the content streaming system may include an additional control server,and in this case, the control server serves to controlcommands/responses between devices in the content streaming system.

The streaming server 420 may receive content from the media storage 440and/or the encoding server 410. For example, when content is receivedfrom the encoding server 410, the streaming server 420 can receive thecontent in real time. In this case, the streaming server 420 may storebitstreams for a predetermined time in order to provide a smoothstreaming service.

Examples of the user equipment 450 may include a cellular phone, asmartphone, a laptop computer, a digital broadcast terminal, a PDA(personal digital assistant), a PMP (portable multimedia player), anavigation device, a slate PC, a tablet PC, an ultrabook, a wearabledevice (e.g., a smartwatch, a smart glass and an HMD (head mounteddisplay)), a digital TV, a desktop computer, a digital signage, etc.

Each server in the content streaming system may be operated as adistributed server, and in this case, data received by each server canbe processed in a distributed manner.

FIG. 5 shows embodiments to which the present disclosure is applicable,FIG. 5A is a diagram for describing a block segmentation structureaccording to QT (Quad Tree), FIG. 5B is a diagram for describing a blocksegmentation structure according to BT (Binary Tree), FIG. 5C is adiagram for describing a block segmentation structure according to TT(Temary Tree), FIG. 5D is a diagram for describing a block segmentationstructure according to AT (Asymmetric Tree).

In video coding, a single block can be segmented on the basis of QT.Further, a single subblock segmented according to QT can be furtherrecursively segmented using QT. A leaf block that is no longer segmentedaccording to QT can be segmented using at least one of BT, TT and AT. BTmay have two types of segmentation; horizontal BT (2N×N, 2N×N); andvertical BT (N×2N, N×2N). TT may have two types of segmentation;horizontal TT (2N×½N, 2N×N, 2N×½N); and vertical TT (½N×2N, N×2N,½N×2N). AT may have four types of segmentation: horizontal-up AT (2N×½N,2N×3/2N); horizontal-down AT (2N×3/2N, 2N×½N); vertical-left AT (½N×2N,3/2N×2N); and vertical-right AT (3/2N×2N, ½N×2N). Each type of BT, TTand AT can be further recursively segmented using BT, TT and AT.

FIG. 5A shows an example of QT segmentation. A block A can be segmentedinto four subblocks A0, A1, A2 and A3 according to QT. The subblock A1can be further segmented into four subblocks B0, B1, B2 and B3 accordingto QT.

FIG. 5B shows an example of BT segmentation. The block B3 that is nolonger segmented according to QT can be segmented into vertical BT (C0and C1) or horizontal BT (D0 and D1). Each subblock such as the block C0can be further recursively segmented into horizontal BT (E0 and E1) orvertical BT (F0 and F1).

FIG. 5C shows an example of TT segmentation. The block B3 that is nolonger segmented according to QT can be segmented into vertical TT (C0,C1 and C2) or horizontal TT (D0, D1 and D2). Each subblock such as theblock C1 can be further recursively segmented into horizontal TT (E0, E1and E2) or vertical TT (F0, F1 and F2).

FIG. 5D shows an example of AT segmentation. The block B3 that is nolonger segmented according to QT can be segmented into vertical AT (C0and C1) or horizontal AT (D0 and D1). Each subblock such as the block C1can be further recursively segmented into horizontal AT (E0 and E1) orvertical TT (F0 and F1).

Meanwhile, BT, TT and AT segmentation may be used in a combined manner.For example, a subblock segmented according to BT may be segmentedaccording to TT or AT. Further, a subblock segmented according to TT maybe segmented according to BT or AT. A subblock segmented according to ATmay be segmented according to BT or TT For example, each subblock may besegmented into vertical BT after horizontal BT segmentation or eachsubblock may be segmented into horizontal BT after vertical BTsegmentation. In this case, finally segmented shapes are identicalalthough segmentation orders are different.

Further, when a block is segmented, a block search order can be definedin various manners. In general, search is performed from left to rightand top to bottom, and block search may mean the order of determiningwhether each segmented subblock will be additionally segmented, anencoding order of subblocks when the subblocks are no longer segmented,or a search order when a subblock refers to information of neighboringother blocks.

Transform may be performed on processing units (or transform blocks)segmented according to the segmentation structures as shown in FIGS. 5 ato 5 d , and particularly, segmentation may be performed in a rowdirection and a column direction and a transform matrix may be applied.According to an embodiment of the present disclosure, differenttransform types may be used according to the length of a processing unit(or transform block) in the row direction or column direction.

Transform is applied to residual blocks in order to decorrelate theresidual blocks as much as possible, concentrate coefficients on a lowfrequency and generate a zero tail at the end of a block. A transformpart in JEM software includes two principal functions (core transformand secondary transform). Core transform is composed of discrete cosinetransform (DCT) and discrete sine transform (DST) transform familiesapplied to all rows and columns of a residual block. Thereafter,secondary transform may be additionally applied to a top left corner ofthe output of core transform. Similarly, inverse transform may beapplied in the order of inverse secondary transform and inverse coretransform. First, inverse secondary transform can be applied to a lefttop corner of a coefficient block. Then, inverse core transform isapplied to rows and columns of the output of inverse secondarytransform. Core transform or inverse transform may be referred to asprimary transform or inverse transform.

FIGS. 6 and 7 show embodiments to which the present disclosure isapplied, FIG. 6 is a schematic block diagram of a transform andquantization unit 120/130, and an inverse quantization and inversetransform unit 140/150 in the encoding apparatus 100 and FIG. 7 is aschematic block diagram of an inverse quantization and inverse transformunit 220/230 in the decoding apparatus 200.

Referring to FIG. 6 , the transform and quantization unit 120/130 mayinclude a primary transform unit 121, a secondary transform unit 122 anda quantization unit 130. The inverse quantization and inverse transformunit 140/150 may include an inverse quantization unit 140, an inversesecondary transform unit 151 and an inverse primary transform unit 152.

Referring to FIG. 7 , the inverse quantization and inverse transformunit 220/230 may include an inverse quantization unit 220, an inversesecondary transform unit 231 and an inverse primary transform unit 232.

In the present disclosure, transform may be performed through aplurality of stages. For example, two states of primary transform andsecondary transform may be applied as shown in FIG. 6 or more than twotransform stages may be used according to algorithms. Here, primarytransform may be referred to core transform.

The primary transform unit 121 can apply primary transform to a residualsignal. Here, primary transform may be predefined as a table in anencoder and/or a decoder.

The secondary transform unit 122 can apply secondary transform to aprimarily transformed signal. Here, secondary transform may bepredefined as a table in the encoder and/or the decoder.

In an embodiment, non-separable secondary transform (NSST) may beconditionally applied as secondary transform. For example, NSST isapplied only to intra-prediction blocks and may have a transform setapplicable per prediction mode group.

Here, a prediction mode group can be set on the basis of symmetry withrespect to a prediction direction. For example, prediction mode 52 andprediction mode 16 are symmetrical on the basis of prediction mode 34(diagonal direction), and thus one group can be generated and the sametransform set can be applied thereto. Here, when transform forprediction mode 52 is applied, input data is transposed and thentransform is applied because a transform set of prediction mode 52 isthe same as that of prediction mode 16.

In the case of the planar mode and the DC mode, there is no symmetrywith respect to directions and thus they have respective transform setsand a corresponding transform set may be composed of two transforms.Each transform set may be composed of three transforms for the remainingdirectional modes.

The quantization unit 130 can perform quantization on a secondarilytransformed signal.

The inverse quantization and inverse transform unit 140/150 performs thereverse of the aforementioned procedure and redundant description isomitted.

FIG. 7 is a schematic block diagram of the inverse quantization andinverse transform unit 220/230 in the decoding apparatus 200.

Referring to FIG. 7 , the inverse quantization and inverse transformunit 220/230 may include the inverse quantization unit 220, the inversesecondary transform unit 231 and the inverse primary transform unit 232.

The inverse quantization unit 220 obtains transform coefficients from anentropy-decoded signal using quantization step size information.

The inverse secondary transform unit 231 performs inverse secondarytransform on the transform coefficients. Here, inverse secondarytransform refers to inverse transform of secondary transform describedin FIG. 6 .

The inverse primary transform unit 232 performs inverse primarytransform on the inversely secondarily transformed signal (or block) andobtains a residual signal. Here, inverse primary transform refers toinverse transform of primary transform described in FIG. 6 .

In addition to DCT-2 and 4×4 DST-4 applied to HEVC, adaptive multipletransform or explicit multiple transform) (AMT or EMT) is used forresidual coding for inter- and intra-coded blocks. A plurality oftransforms selected from DCT/DST families is used in addition totransforms in HEVC. Transform matrices newly introduced in JEM areDST-7, DCT-8, DST-1, and DCT-5. The following table 1 shows basicfunctions of selected DST/DCT.

TABLE 1 Transform Basis function T_(i)(j), Type i, j = 0, 1, . . . , N −1 DCT-II${{T_{l}(j)} = {\omega_{0} \cdot \sqrt{\frac{2}{N}} \cdot {\cos\left( \frac{\pi \cdot i \cdot \left( {{2j} + 1} \right)}{2N} \right)}}}{{{where}\omega_{0}} = \left\{ \begin{matrix}\sqrt{\frac{2}{N}} & {i = 0} \\1 & {i \neq 0}\end{matrix} \right.}$ DCT-V${{T_{i}(j)} = {\omega_{0} \cdot \omega_{1} \cdot \sqrt{\frac{2}{{2N} - 1}} \cdot {\cos\left( \frac{2{\pi \cdot i \cdot j}}{{2N} - 1} \right)}}},{{{where}{}\omega_{0}} = \left\{ {\begin{matrix}\sqrt{\frac{2}{N}} & {i = 0} \\1 & {i \neq 0}\end{matrix},{\omega_{1} = \left\{ \begin{matrix}\sqrt{\frac{2}{N}} & {j = 0} \\1 & {j \neq 0}\end{matrix} \right.}} \right.}$ DCT-VIII${T_{i}(j)} = {\sqrt{\frac{4}{{2N} + 1}} \cdot {\cos\left( \frac{\pi \cdot \left( {{2i} + 1} \right) \cdot \left( {{2j} + 1} \right)}{{4N} + 2} \right)}}$DST-I${T_{i}(j)} = {\sqrt{\frac{2}{N + 1}} \cdot {\sin\left( \frac{\pi \cdot \left( {i + 1} \right) \cdot \left( {j + 1} \right)}{N + 1} \right)}}$DST-VII${T_{i}(j)} = {\sqrt{\frac{4}{{2N} + 1}} \cdot {\sin\left( \frac{\pi \cdot \left( {{2i} + 1} \right) \cdot \left( {j + 1} \right)}{{2N} + 1} \right)}}$

EMT can be applied to CUs having a width and height equal to or lessthan 64 and whether EMT is applied can be controlled by a CU level flag.When the CU level flag is 0, DCT-2 is applied to CUs in order to encoderesidue. Two additional flags are signaled in order to identifyhorizontal and vertical transforms to be used for a luma coding block ina CU to which EMT is applied. As in HEVC, residual of a block can becoded in a transform skip mode in JEM. For intra-residual coding, amode-dependent transform candidate selection process is used due toother residual statistics of other intra-prediction modes. Threetransform subsets are defined as shown in the following table 2 and atransform subset is selected on the basis of an intra-prediction mode asshown in Table 3.

TABLE 2 Transform Transform Set Candidates 0 DST-VII, DCT-VIII 1DST-VII, DST-I 2 DST-VII, DCT-VIII

Along with the subset concept, a transform subset is initially confirmedon the basis of Table 2 by using the intra-prediction mode of a CUhaving a CU-level EMT_CU_flag of 1. Thereafter, for each of horizontalEMT_TU_horizontal_flag) and vertical (EMT_TU_vertical_flag) transforms,one of two transform candidates in the confirmed transform subset isselected on the basis of explicit signaling using flags according toTable 3.

TABLE 3 Intra Mode 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 V 2 1 0 1 01 0 1 0 1 0 1 0 1 0 0 0 H 2 1 0 1 0 1 0 1 0 1 0 1 0 1 2 2 2 Intra Mode17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 V 0 0 0 0 0 0 1 0 1 01 0 1 0 1 0 1 H 2 2 2 2 2 2 1 0 1 0 1 0 1 0 1 0 1 Intra Mode 34 35 36 3738 39 40 41 42 43 44 45 46 47 48 49 50 V 0 1 0 1 0 1 0 1 0 1 0 1 2 2 2 22 H 0 1 0 1 0 1 0 1 0 1 0 1 0 0 0 0 0 Intra Mode 51 52 53 54 55 56 57 5859 60 61 62 63 64 65 66 V 2 2 2 2 1 0 1 0 1 0 1 0 1 0 1 0 H 0 0 0 0 1 01 0 1 0 1 0 1 0 1 0

TABLE 4 Horizontal Vertical 35 intra 67 intra Configuration (row)(column) Prediction Prediction Group transform transform modes modesGroup 0 0 DST7 DST7 0 0 (G0) 1 DCT5 DST7 2 DST7 DCT5 3 DCT5 DCT5 Group 10 DST7 DST7 1, 3, 5, 7, 13, 15, 17, 1, 3, 5, 7, 9, 11, 13, (G1) 1 DST1DST7 19, 21, 23, 29, 31, 33 23, 25, 27, 29, 31, 33, 2 DST7 DST1 35, 37,39, 41, 43, 45, 3 DST1 DST1 55, 57, 59, 61, 63, 65 Group 2 0 DST7 DST72, 4, 6, 14, 16, 18, 20, 2, 4, 6, 8, 10, 12, 24, (G2) 1 DCT8 DST7 22,30, 32, 34 26, 28, 30, 32, 34, 36, 2 DST7 DCT8 38, 40, 42, 44, 56, 58, 3DCT8 DCT8 60, 64, 66 Group 3 0 DST7 DST7 8, 9, 10, 11, 12 14, 15, 16,17, 18, 19, (G3) 1 DCT5 DST7 (Neighboring angles 20, 21, 22 2 DST7 DCT8to horizontal (Neighboring angles 3 DCT5 DCT8 directions) to horizontaldirections) Group 4 0 DST7 DST7 24, 25, 26, 27, 28 46, 47, 48, 49, 50,51, (G4) 1 DCT8 DST7 (Neighboring angles 52, 53, 54 2 DST7 DCT5 tovertical directions) (Neighboring angles 3 DCT8 DCT5 to verticaldirections) Group 5 0 DCT8 DCT8 Inter prediction Inter prediction (G5) 1DST7 DCT8 2 DCT8 DST7 3 DST7 DST7

Table 4 shows a transform configuration group to which adaptive multipletransform (AMT) is applied as an embodiment to which the presentdisclosure is applied.

Referring to Table 4, transform configuration groups are determined onthe basis of a prediction mode and the number of groups may be 6 (G0 toG5). In addition. G0 to G4 correspond to a case in whichintra-prediction is applied and G5 represents transform combinations (ortransform set or transform combination set) applied to a residual blockgenerated according to inter-prediction.

One transform combination may be composed of horizontal transform (orrow transform) applied to rows of a corresponding 2D block and verticaltransform (or column transform) applied to columns thereof.

Here, each of the transform configuration groups may have four transformcombination candidates. The four transform combination candidates may beselected or determined using transform combination indexes 0 to 3 and atransform combination index may be encoded and transmitted from anencoder to a decoder.

In an embodiment, residual data (or residual signal) obtained throughintra-prediction may have different statistical characteristicsaccording to intra-prediction modes. Accordingly, transforms other thannormal cosine transform may be applied for respective intra-predictionsas shown in Table 4. In the present description, a transform type may berepresented as DCT-Type 2, DCT-II or DCT-2, for example.

Referring to Table 4, a case in which 35 intra-prediction modes are usedand a case in which 67 intra-prediction modes are used are shown. Aplurality of transform combinations may be applied for each transformconfiguration group classified in each intra-prediction mode column. Forexample, a plurality of transform combinations may be composed of fourcombinations (of transforms in the row direction and transforms in thecolumn direction). As a specific example, DST-7 and DCT-5 can be appliedto group 0 in both the row (horizontal) direction and the column(vertical) direction and thus a total of four groups can be applied.

Since a total of four transform kernel combinations can be applied toeach intra-prediction mode, a transform combination index for selectingone therefrom can be transmitted per transform unit. In the presentdescription, a transform combination index may be referred to as an AMTindex and may be represented by amt_idx.

Furthermore, a case in which DCT-2 is optimal for both the row directionand the column direction may be generated due to characteristics of aresidual signal in addition to the transform kernels shown in Table 4.Accordingly, transform can be adaptively applied by defining an AMT flagfor each coding unit. Here, DCT-2 can be applied to both the rowdirection and the column direction when the AMT flag is 0 and one offour combinations can be selected or determined through an AMT indexwhen the AMT flag is 1.

In an embodiment, if the number of transform coefficients is less than 3for one transform unit when the AMT flag is 0, the transform kernels ofTable 4 is not applied and DST-7 may be applied to both the rowdirection and the column direction.

In an embodiment, if transform coefficient values are previously parsedand thus the number of transform coefficients is less than 3, an AMTindex is not parsed and DST-7 is applied and thus the amount oftransmission of additional information can be reduced.

In an embodiment, AMT can be applied only when both the width and heightof a transform unit are equal to or less than 32.

In an embodiment, Table 4 can be preset through off-line training.

In an embodiment, the AMT index can be defined as one index that canindicate a combination of horizontal transform and vertical transform.Alternatively, the AMT index can be defined as separate horizontaltransform index and vertical transform index.

FIG. 8 is a flowchart showing a process of performing adaptive multipletransform (AMT).

Although an embodiment with respect to separable transform that isseparately applied in the horizontal direction and the verticaldirection is basically described in the present description, a transformcombination may be composed of non-separable transforms.

Alternatively, a transform combination may be configured as a mixture ofseparable transforms and non-separable transforms. In this case,row/column-wise transform selection or selection in thehorizontal/vertical direction is unnecessary when separable transform isused and the transform combinations of Table 4 can be used only whenseparable transform is selected.

In addition, methods proposed in the present description can be appliedirrespective of primary transform and secondary transform. That is, themethods can be applied to both the transforms. Here, primary transformcan refer to transform for initially transforming a residual block andsecondary transform can refer to transform for applying transform to ablock generated as a result of primary transform.

First, the encoding apparatus 100 can determine a transform groupcorresponding to a current block (S805). Here, the transform group mayrefer to a transform group of Table 4 but the present disclosure is notlimited thereto and the transform group may be composed of othertransform combinations.

The encoding apparatus 100 can perform transform on available candidatetransform combinations in the transform group (S810). As a result oftransform, the encoding apparatus 100 can determine or select atransform combination with a lowest rate distortion (RD) cost (S815).The encoding apparatus 100 can encode a transform combination indexcorresponding to the selected transform combination (S820).

FIG. 9 is a flowchart showing a decoding process of performing AMT.

First, the decoding apparatus 200 can determine a transform group forthe current block (S905). The decoding apparatus 200 can parse atransform combination index, and the transform combination index cancorrespond to one of a plurality of transform combinations in thetransform group (S910). The decoding apparatus 200 can derive atransform combination corresponding to the transform combination index(S915). Here, although the transform combination may refer to atransform combination shown in Table 4, the present disclosure is notlimited thereto. That is, the transform combination may be configured asother transform combinations.

The decoding apparatus 200 can perform inverse transform on the currentblock on the basis of the transform combination (S920). When thetransform combination is composed of row transform and column transform,row transform may be applied and then column transform may be applied.However, the present disclosure is not limited thereto, and rowtransform may be applied after column transform is applied, and when thetransform combination is composed of non-separable transforms, anon-separable transform can be immediately applied.

In another embodiment, the process of determining a transform group andthe process of parsing a transform combination index may besimultaneously performed.

In the embodiment of the present disclosure, the aforementioned term“AMT” may be redefined as “multiple transform set or multiple transformselection (MTS)”. MTS related syntaxes and semantics described below aresummarized in Versatile Video coding (VVC) JVET-K1001-v4.

In an embodiment of the present disclosure, two MIS candidates can beused for directional modes and four MTS candidates can be used fornondirectional modes as follows.

A) Nondirectional modes (DC and planar)

DST-7 is used for horizontal and vertical transforms when MTS index is0.

DST-7 is used for vertical transform and DCT-8 is used for horizontaltransforms when MTS index is 1.

DCT-8 is used for vertical transform and DST-7 is used for horizontaltransforms when MTS index is 2.

DCT-8 is used for horizontal and vertical transforms when MTS index is3.

B) Modes belonging to horizontal group modes

DST-7 is used for horizontal and vertical transforms when MTS index is0.

DCT-8 is used for vertical transform and DST-7 is used for horizontaltransforms when MTS index is 1.

C) Modes belonging to vertical group modes

DST-7 is used for horizontal and vertical transforms when MIS index is0.

DST-7 is used for vertical transform and DCT-8 is used for horizontaltransforms when MTS index is 1.

Here (In VTM 2.0 in which 67 modes are used), horizontal group modesinclude intra-prediction modes 2 to 34 and vertical modes includeintra-prediction modes 35 to 66.

In another embodiment of the present disclosure, three MTS candidatesare used for all intra-prediction modes.

DST-7 is used for horizontal and vertical transforms when MTS index is0.

DST-7 is used for vertical transform and DCT-8 is used for horizontaltransforms when MTS index is 1.

DCT-8 is used for vertical transform and DST-7 is used for horizontaltransforms when MTS index is 2.

In another embodiment of the present disclosure, two MTS candidates areused for directional prediction modes and three MTS candidates are usedfor nondirectional modes.

A) Nondirectional modes (DC and planar)

DST-7 is used for horizontal and vertical transforms when MTS index is0.

DST-7 is used for vertical transform and DCT-8 is used for horizontaltransforms when MTS index is 1.

DCT-8 is used for vertical transform and DST-7 is used for horizontaltransforms when MTS index is 2.

B) Prediction modes corresponding to horizontal group modes

DST-7 is used for horizontal and vertical transforms when MTS index is0.

DCT-8 is used for vertical transform and DST-7 is used for horizontaltransforms when MTS index is 1.

C) Prediction modes corresponding to vertical group modes

DST-7 is used for horizontal and vertical transforms when MIS index is0.

DST-7 is used for vertical transform and DCT-8 is used for horizontaltransforms when MTS index is 1.

In another embodiment of the present disclosure, one MTS candidate(e.g., DST-7) can be used for all intra-modes. In this case, encodingtime can be reduced by 40% with some minor coding loss. In addition, oneflag may be used to indicate between DCT-2 and DST-7.

FIG. 10 is a flowchart showing an inverse transform process on the basisof MTS according to an embodiment of the present disclosure.

The decoding apparatus 200 to which the present disclosure is appliedcan obtain sps_mts_intra_enabled_flag or sps_mts_inter_enabled_flag(S1005). Here, sps_mts_intra_enabled_flag indicates whether cu_mts_flagis present in a residual coding syntax of an intra-coding unit. Forexample, cu_mts_flag is not present in the residual coding syntax of theintra-coding unit if sps_mts_intra_enabled_flag=0 and cu_mts_flag ispresent in the residual coding syntax of the intra-coding unit if,sps_mts_intra_enabled_flag=1. In addition, sps_mts_inter_enabled_flagindicates whether cu_mts_flag is present in a residual coding syntax ofan inter-coding unit. For example, cu_mts_flag is not present in theresidual coding syntax of the inter-coding unit ifsps_mts_inter_enabled_flag=0 and cu_mts_flag is present in the residualcoding syntax of the inter-coding unit if sps_mts_inter_enabled_flag=1.

The decoding apparatus 200 can obtain cu_mts_flag on the basis ofsps_mts_intra_enabled_flag or sps_mts_inter_enabled_flag (S1010). Forexample, the decoding apparatus 200 can obtain cu_mts_flag whensps_mts_intra_enabled_flag=1 or sps_mts_inter_enabled_flag=1. Here,cu_mts_flag indicates whether MTS is applied to a residual sample of aluma transform block. For example, MTS is not applied to the residualsample of the luma transform block if cu_mts_flag=0 and MTS is appliedto the residual sample of the luma transform block if cu_mts_flag=1.

The decoding apparatus 200 can obtain mts_idx on the basis ofcu_mts_flag (S1015). For example, when cu_mts_flag=1, the decodingapparatus 200 can obtain mts_idx. Here, mts_idx indicates whichtransform kernel is applied to luma residual samples of a currenttransform block in the horizontal direction and/or the verticaldirection.

For example, at least one of embodiments described in the presentdescription can be applied to mts_idx.

The decoding apparatus 200 can derive a transform kernel correspondingto mts_idx (S1020). For example, the transform kernel corresponding tomts_idx can be separately defined as horizontal transform and verticaltransform.

For example, when MTS is applied to the current block (i.e.,cu_mts_flag=1), the decoding apparatus 200 can configure MIS candidateson the basis of the intra-prediction mode of the current block. In thiscase, the decoding flowchart of FIG. 10 may further include a step ofconfiguring MTS candidates. Then, the decoding apparatus 200 candetermine an MTS candidate to be applied to the current block from amongthe configured MTS candidates using mts_idx.

As another example, different transform kernels can be applied tohorizontal transform and vertical transform. However, the presentdisclosure is not limited thereto and the same transform kernel may beapplied to the horizontal transform and vertical transform.

The decoding apparatus 200 can perform inverse transform on the basis ofthe transform kernel (S1025).

Furthermore, in the specification, MTS may be represented as AMT or EMTand mts_idx may be represented as AMT_idx, EMT_idx, AMT_TU_idxEMT_TU_idx, or the like but the present disclosure is not limitedthereto.

The present disclosure is described by being divided into a case inwhich the MTS is applied and a case in which the MTS is not appliedbased on the MTS flag, but is not limited to such an expression. Forexample, whether or not the MTS is applied may be the same meaning aswhether to use other transform types (or transform kernels) other than apredefined specific transform type (which may be referred to as a basictransform type, a default transform type, etc.). If the MTS is applied,a transform type (e.g., any one transform type or a combined transformtype of two or more transform types among a plurality of transformtypes) other than a basic transform type may be used for a transform.Further, if the MTS is not applied, the basic transform type may be usedfor the transform. In an embodiment, the basic transform type may beconfigured (or defined) as DCT2.

As an example, when a MTS flag syntax indicating whether or not the MTSis applied to a current transform block and the MTS are applied, a MTSindex syntax indicating a transform type applied to the currenttransform block may also be individually transmitted from an encoder toa decoder. As another example, when whether or not the MTS is applied toa current transform block and the MTS are applied, a syntax (e.g., MTSindex) including all of transform types applied to the current transformblock may also be transmitted from an encoder to a decoder. That is, inthe latter example, a syntax (or syntax element) indicating a transformtype applied to the current transform block (or unit) may be transmittedfrom the encoder to the decoder within all of transform type groups (ortransform type sets) including the above-described basic transform type.

Accordingly, in spite of the expression, a syntax (MTS index) indicatinga transform type applied to the current transform block may includeinformation about whether or not the MTS is applied. In other words, inthe latter example, only the MTS index may be signaled without the MTSflag, and in this case, it may be understood that DCT2 is included inthe MTS. However, in the present disclosure, it may be described thatthe application of DCT2 means that the MTS is not applied. Nevertheless,the technical range with respect to the MTS is not limited to thecorresponding definition.

FIG. 11 is a block diagram of an apparatus that performs decoding on thebasis of MTS according to an embodiment of the present disclosure.

The decoding apparatus 200 to which the present disclosure is appliedmay include a sequence parameter acquisition unit 1105, an MTS flagacquisition unit 1110, an MTS index acquisition unit 1115, and atransform kernel derivation unit 1120.

The sequent parameter acquisition unit 1105 can acquiresps_mts_intra_enabled_flag or sps_mts_inter_enabled_flag. Here,sps_mts_intra_enabled_flag indicates whether cu_mts_flag is present in aresidual coding syntax of an intra-coding unit andsps_mts_inter_enabled_flag indicates whether cu_mts_flag is present in aresidual coding syntax of an inter-coding unit. Description withreference to FIG. 10 may be applied to a specific example.

The MTS flag acquisition unit 1110 can acquire cu_mts_flag on the basisof sps_mts_intra_enabled_flag or sps_mts_inter_enabled_flag. Forexample, the MTS flag acquisition unit 1110 can acquire cu_mts_flag whensps_mts_intra_enabled_flag=1 or sps_mts_inter_enabled_flag=1. Here,cu_mts_flag indicates whether MTS is applied to a residual sample of aluma transform block. Description with reference to FIG. 10 may beapplied to a specific example.

The MTS index acquisition unit 1115 can acquire mts_idx on the basis ofcu_mts_flag. For example, the MTS index acquisition unit 1115 canacquire mts_idx when cu_mts_flag=1. Here, mts_idx indicates whichtransform kernel is applied to luma residual samples of the currenttransform block in the horizontal direction and/or the verticaldirection. Description with reference to FIG. 10 may be applied to aspecific example.

The transform kernel derivation unit 1120 can derive a transform kernelcorresponding to mts_idx. Then, the decoding apparatus 200 can performinverse transform on the basis of the derived transform kernel.

Mode-dependent non-separable secondary transform (MDNSST) is introduced.To maintain low complexity, MDNSST is applied to only low-frequencycoefficients after primary transform. Further, non-separable transformchiefly applied to low-frequency coefficients may be called LFNST (lowfrequency non-separable transform). If both the width (W) and height (H)of a transform coefficient block are equal to or greater than 8, 8×8non-separable secondary transform is applied to an 8×8 left top regionof the transform coefficient block. 4×4 non-separable secondarytransform is applied if the width or height is less than 8, and the 4×4non-separable secondary transform can be performed on left top min(8,W)×min(8, H) of the transform coefficient block. Here, min(A, B) is afunction of outputting a smaller value between A and B. Further, W×H isthe block size, W represents the width and H represents the height.

A total of 35×3 non-separable secondary transforms may be present forblock sizes 4×4 and 8×8. Here, 35 is the number of transform setsspecified by intra-prediction modes and 3 is the number of NSSTcandidates for each prediction mode. Mapping from intra-prediction modesto transform sets may be defined in the following table 5.

TABLE 5 intra mode 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Set 0 1 2 34 5 6 7 8 9 10 11 12 13 14 15 16 intra mode 17 18 19 20 21 22 23 24 2526 27 28 29 30 31 32 33 Set 17 18 19 20 21 22 23 24 25 26 27 28 29 30 3132 33 intra mode 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 Set34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 intra mode 50 51 5254 55 56 57 58 59 60 61 62 63 64 65 66 67(LM) Set 17 16 15 14 13 12 1110 9 8 7 6 5 4 3 2 NULL

In order to indicate a transform kernel among transform sets, an NSSTindex (NSST idx) can be coded. When NSST is not applied. NSST indexequal to 0 is signalled.

FIGS. 12 and 13 are flowcharts showing encoding/decoding to whichsecondary transform is applied as an embodiment to which presentdisclosure is applied.

In JEM, secondary transform (MDNSST) is not applied for a block codedwith transform skip mode. When the MDNSST index is signalled for a CUand not equal to zero, MDNSST is not used for a block of a componentthat is coded with transform skip mode in the CU. The overall codingstructure including coefficient coding and NSST index coding is shown inFIGS. 12 and 13 . A CBF flag is encoded to determine whether coefficientcoding and NSST coding are performed. In FIGS. 12 and 13 , the CBF flagcan represent a luma block cbg flag (cbf_luma flag) or a chroma blockcbf flag (cbf_cb flag or cbf_cr flag). When the CBF flag is 1, transformcoefficients are coded.

Referring to FIG. 12 , the encoding apparatus 100 checks whether CBF is1 (S1205). If CBF is 0, the encoding apparatus 100 does not performtransform coefficient encoding and NSST index encoding. If CBF is 1, theencoding apparatus 100 performs encoding on transform coefficients(S1210). Thereafter, the encoding apparatus 100 determines whether toperform NSST index coding (S1215) and performs NSST index coding(S1220). When NSST index coding is not applied, the encoding apparatus100 can end the transform procedure without applying NSST and performthe subsequent step (e.g., quantization).

Referring to FIG. 13 , the decoding apparatus 200 checks whether CBF is1 (S1305). If CBF is 0, the decoding apparatus 200 does not performtransform coefficient decoding and NSST index decoding. If CBF is 1, thedecoding apparatus 200 performs decoding on transform coefficients(S1310). Thereafter, the decoding apparatus 200 determines whether toperform NSST index coding (S1315) and parse an NSST index (S1320).

NSST can be applied to an 8×8 or 4×4 left top region instead of beingapplied to the entire block (TU in the case of HEVC) to which primarytransform has been applied. For example, 8×8 NSST can be applied when ablock size is 8×8 or more (that is, both of the width and height of ablock is greater than or equal to 8) and 4×4 NSST can be applied when ablock size is less than 8×8 (that is, both of the width and height isless than 8). Further, when 8×8 NSST is applied (that is, when a blocksize is 8×8 or more), 4×4 NSST can be applied per 4×4 block (that is,top left 8×8 region is divided into 4×4 blocks and 4×4 NSST is appliedto each 4×4 block). Both 8×8 NSST and 4×4 NSST can be determinedaccording to the above-described transform set configuration, and 8×8NSST may have 64 pieces of input data and 64 pieces of output data and4×4 NSST may have 16 inputs and 16 outputs because they arenon-separable transforms.

FIGS. 14 and 15 show an embodiment to which the present disclosure isapplied, FIG. 14 is a diagram for describing Givens rotation and FIG. 15shows a configuration of one round in 4×4 NSST composed of Givensrotation layers and permutations.

Both 8×8 NSST and 4×4 NSST can be configured as hierarchicalcombinations of Givens rotations. A matrix corresponding to one Givensrotation is represented as Equation 1 and a matrix product isrepresented as FIG. 14 .

$\begin{matrix}{R_{\theta} = \begin{bmatrix}{\cos\theta} & {{- \sin}\theta} \\{\sin\theta} & {\cos\theta}\end{bmatrix}} & \left\lbrack {{Equation}1} \right\rbrack\end{matrix}$

In FIG. 14 , t_(m) and t_(n) output according to Givens rotation can becalculated as represented by Equation 2.t _(m) =x _(m) cos θ−x _(n) sin θt _(n) =x _(m) sin θ+x _(n) cos θ  [Equation 2]

Since Givens rotation rotates two pieces of data as shown in FIG. 14 ,32 or 8 Givens rotations are required to process 64 (in the case of 8×8NSST) or 16 (in the case of 4×4 NSST) pieces of data. Accordingly, agroup of 32 or 8 Givens rotations can form a Givens rotation layer. Asshown in FIG. 15 , output data for one Givens rotation layer istransmitted as input data for the next Givens rotation layer throughpermutation (shuffling). A pattern permuted as shown in FIG. 15 isregularly defined, and in the case of 4×3 NSST, four Givens rotationlayers and corresponding permutations form one round. 4×4 NSST isperformed by two rounds and 8×8 NSST is performed by four rounds.Although different rounds use the same permutation pattern, appliedGivens rotation angles are different. Accordingly, angle data for allGivens rotations constituting each permutation needs to be stored.

As a final step, one more permutation is finally performed on dataoutput through Givens rotation layers, and information aboutcorresponding permutation is separately stored for each permutation.Corresponding permutation is performed at the end of forward NSST andcorresponding reverse permutation is initially applied in inverse NSST.

Reverse NSST reversely performs Givens rotation layers and permutationsapplied to forward NSST and performs rotation by taking a negative valuefor each Given rotation angle.

RST (Reduced Secondary Transform)

FIG. 16 shows operation of RST as an embodiment to which the presentdisclosure is applied.

When an orthogonal matrix representing a transform is N×N, a reducedtransform (RT) leaves only R of N transform basic vectors (R<N). Amatrix with respect to forward RT that generates transform coefficientscan be defined by Equation 3.

$\begin{matrix}{T_{R \times N} = \begin{bmatrix}t_{11} & \ldots & t_{1N} \\ \vdots & \ddots & \vdots \\t_{R1} & \ldots & t_{RN}\end{bmatrix}} & \left\lbrack {{Equation}3} \right\rbrack\end{matrix}$

Since a matrix with respect to reverse RT is a transpose matrix of aforward RT matrix, application of forward RT and reverse RT isschematized as shown in FIGS. 16A and 16B.

RT applied to an 8×8 left top block of a transform coefficient block towhich primary transform has been applied can be referred to as 8×8 RST.When R is set to 16 in Equation 3, forward 8×8 RST has a form of 16×64matrix and reverse 8×8 RST has a form of 64×16 matrix. In this case, anM×N matrix may consist of M rows and N columns. Further, the transformset configuration as shown in Table 5 can be applied to 8×8 RST. Thatis, 8×8 RST can be determined on the basis of transform sets accordingto intra-prediction modes as shown in Table 5. Since one transform setis composed of two or three transforms according to an intra-predictionmode, one of a maximum of four transforms including a case in whichsecondary transform is not applied can be selected (one transform cancorrespond to an anisotropic matrix). When indices 0, 1, 2 and 3 areassigned to the four transforms, a transform to be applied can bedesignated by signaling a syntax element corresponding to an NSST indexfor each transform coefficient block. For example, the index 9 canassigned to an anisotropic matrix, that is, a case in which secondarytransform is not applied. Consequently, 8×8 NSST can be designatedaccording to JEM NSST and 8×8 RST can be designated according to RSTconfiguration for an 8×8 left top block through the NSST index.

FIG. 17 is a diagram showing a process of performing reverse scanningfrom the sixty-fourth coefficient to the seventeenth coefficient inreverse scan order as an embodiment to which the present disclosure isapplied.

When 8×8 RST as represented by Equation 3 is applied, 16 valid transformcoefficients are generated and thus 64 pieces of input data constitutingan 8×8 region are reduced to 16 pieces of output data and only a quarterregion is filled with valid transform coefficients according to theviewpoint of two-dimensional region. Accordingly, the 16 pieces ofoutput data obtained by applying forward 8×8 RST fill a left top regionof FIG. 17 .

In FIG. 17 , a 4×4 left top region becomes a region of interest (ROI)filled with valid transform coefficients and the remaining region isvacant. The vacant region may be filled with 0 as a default value. Ifnon-zero valid transform coefficients are discovered in regions otherthan the ROI of FIG. 17 , 8×8 RST has not been definitely applied andthus corresponding coding may be omitted for corresponding NSST index.On the other hand, if non-zero valid transform coefficients are notdiscovered in regions other than the ROI of FIG. 17 (8×8 RST is appliedor regions other than the ROI are filled with 0), the NSST index may becoded because 8×8 RST might be applied. Such conditional NSST indexcoding requires checking presence or absence of a non-zero transformcoefficient and thus can be performed after the residual coding process.

FIG. 18 is an exemplary flowchart showing encoding using a singletransform indicator as an embodiment to which the present disclosure isapplied.

In an embodiment of the present disclosure, the single transformindicator (STI) is introduced. A single transform can be applied whenthe STI is enabled (STI coding=1) instead of sequentially used twotransforms (primary transform and secondary transform). Here, the singletransform may be any type of transform. For example, the singletransform may be a separable transform or a non-separable transform. Thesingle transform may be a transform approximated from a non-separabletransform. A single transform index (ST_idx in FIG. 18 ) can be signaledwhen the STI has been enabled. Here, the single transform index canindicate a transform to be applied form among available transformcandidates.

Referring to FIG. 18 , the encoding apparatus 100 determines whether CBFis 1 (S1805). When CBF is 1, the encoding apparatus 100 determineswhether STI coding is applied (S1810). When STI coding is applied, theencoding apparatus 100 encodes an STI index STI_idx (S1845) and performscoding on transform coefficient (S1850). When STI coding is not applied,the encoding apparatus 100 encodes a flag EMT_CU_Flag indicating whetherEMT (or MTS) is applied at a CU level (S1815). Thereafter, the encodingapparatus 100 performs coding on the transform coefficients (S1820).Then, the encoding apparatus 100 determines whether EMT is applied to atransform unit (TU) (S1825). When EMT is applied to the TU, the encodingapparatus 100 encodes a primary transform index EMT_TU Idx applied tothe TU (S1830). Subsequently, the encoding apparatus 100 determineswhether NSST is applied (S1835). When NSST is applied, the encodingapparatus 100 encodes an index NSST_Idx indicating NSST to be applied(S1840).

In an example, if single transform coding conditions aresatisfied/enabled (e.g., STI coding==1), the single transform indexST_Idx may be implicitly derived instead of being signaled. ST_idx canbe implicitly determined on the basis of a block size and anintra-prediction mode. Here, ST_Idx can indicate a transform (ortransform kernel) applied to the current transform block.

The STI can be enabled if one or more of the following conditions aresatisfied (STI_coding==1).

1) The block size corresponds to a predetermined value such as 4 or 8.

2) Block width=Block height (square block)

3) The intra-prediction mode is one of predetermined modes such as DCand planar modes.

In another example, the STI coding flag can be signaled in order toindicate whether the single transform is applied. The STI coding flagcan be signaled on the basis of an STI coding value and CBF. Forexample, the STI coding flag can be signaled when CBF is 1 and STIcoding is enabled. Furthermore, the STI coding flag can be conditionallysignaled in consideration of a block size, a block shape (square blockor non-square block) or an intra-prediction mode.

To use information acquired during coefficient coding, ST_idx may bedetermined after coefficient coding. In an example, ST_idx can beimplicitly determined on the basis of a block size, an intra-predictionmode and the number of non-zero coefficients. In another example, ST_idxcan be conditionally encoded/decoded on the basis of a block size, ablock shape, an intra-prediction mode and/or the number of non-zerocoefficients. In another example, ST_idx signaling may be omitteddepending on a distribution of non-zero coefficients (i.e., positions ofnon-zero coefficients). Particularly, when non-zero coefficients arediscovered in a region other than a 4×4 left top region, ST_idxsignaling can be omitted.

FIG. 19 is an exemplary flowchart showing encoding using a unifiedtransform indicator (UTI) as an embodiment to which the presentdisclosure is applied.

In an embodiment of the present disclosure, the unified transformindicator is introduced. The UTI includes a primary transform indicatorand a secondary transform indicator.

Referring to FIG. 19 , the encoding apparatus 100 determines whether CBFis 1 (S1905). When CBF is 1, the encoding apparatus 100 determineswhether UTI coding is applied (S1910). When UTI coding is applied, theencoding apparatus 100 encodes a UTI index UTI_idx (S1945) and performscoding on transform coefficient (S1950). When UTI coding is not applied,the encoding apparatus 100 encodes the flag EMT_CU_Flag indicatingwhether EMT (or MTS) is applied at the CU level (S1915). Thereafter, theencoding apparatus 100 performs coding on the transform coefficients(S1920). Then, the encoding apparatus 100 determines whether EMT isapplied to a transform unit (TU) (S1925). When EMT is applied to the TU,the encoding apparatus 100 encodes a primary transform index EMT_TU Idxapplied to the TU (S1930). Subsequently, the encoding apparatus 100determines whether NSST is applied (S1935). When NSST is applied, theencoding apparatus 100 encodes an index NSST_Idx indicating NSST to beapplied (S1940).

The UTI may be coded for each predetermined unit (CTU or CU).

The UTI coding mode may be dependent on the following conditions.

1) Block size

2) Block shape

3) Intra-prediction mode

How to derive/extract a core transform index from the UTI is defined inadvance. How to derive/extract a secondary transform index from the UTIis defined in advance.

A syntax structure for the UTI can be optionally used. The UTI candepend on a CU (TU) size. For example, a smaller CU (TU) may have a UTIindex in a narrower range. In an example, the UTI can indicate only thecore transform index if a predefined condition (e.g., a block size isless than a predefined threshold value) is satisfied.

TABLE 6 UTI- Binalization Core Secondary Index (FLC) Transform IdxTransform Idx 0 00000 0 0 1 00001 0 1 2 00010 0 2 3 00011 0 3 4 00100 10 5 00101 1 1 6 00110 1 2 7 00111 1 3 ... ... ... ... 31 11111 5 3

In another example, UTI index may be considered as the core transformindex when secondary transform is not indicated to be used (e.g.,secondary transform index==0 or secondary transform is alreadypredetermined). In the same manner, UTI index may be considered as asecondary transform index when the core transform index is considered tobe known. Specifically, considering the intra prediction mode and theblock size, a predetermined core transform may be used.

FIG. 20A and FIG. 20B illustrate two exemplary flowcharts showingencoding using the UTI as an embodiment to which the present disclosureis applied.

In another example, the transform coding structure may use UTI indexcoding as shown in FIG. 20 and FIG. 20B. Here, the UTI index may becoded earlier than coefficient coding or later than coefficient coding.

Referring to FIG. 20A, the encoding apparatus 100 checks whether CBF is1 (S2005). When CBF is 1, the encoding apparatus 100 codes the UTI indexUTI_idx (S2010) and performs coding on transform coefficients (S2015).

Referring to FIG. 20B, the encoding apparatus 100 checks whether CBF is1 (S2055). When CBF is 1, the encoding apparatus 100 performs coding onthe transform coefficients (S2060) and codes the UTI index UTI_idx(S2065).

In another embodiment of the present disclosure, data hiding andimplicit coding methods for transform indicators are introduced. Here,transform indicators may include ST_idx, UTI_idx, EMT_CU_Flag, EMT_TUFlag, NSST_Idx and any sort of transform related index which may be usedto indicate a transform kernel. The above-mentioned transform indicatormay not be signaled but the corresponding information may be inserted ina coefficient coding process (it can be extracted during a coefficientcoding process). The coefficient coding process may include thefollowing parts.

-   -   Last_position_x, Last_position_y    -   Group flag    -   Significance map    -   Greather_than_1 flag    -   Greather_than_2 flag    -   Remaining level coding    -   Sign coding

For example, transform indicator information may be inserted in one ormore of above-mentioned coefficient coding processes. In order to inserttransform indicator information, the followings may be consideredjointly.

Pattern of sing coding

The absolute value of remaining level

The number of Greather_than_1 flag

The values of Last_position_X and Last_position_Y

The above-mentioned data hiding method may be considered conditionally.For example, the data hiding method may be dependent on the number ofnon-zero coefficients.

In another example, NSST_idx and EMT_idx may be dependent. For example,NSST_idx may not be zero when EMT_CU_Flag is equal to zero (or one). Inthis case, NSST_idx−1 may be signaled instead of NSST_idx.

In another embodiment of the present disclosure, NSST transform setmapping based on intra-prediction mode is introduced as shown in thefollowing table 7. Although NSST is described below as an example ofnon-separable transform, another known terminology (e.g., LFNST) may beused for non-separable transform. For example, NSST set and NSST indexmay be replaced with LFNST set and LFNST index. Further, RST describedin this specification may also be replaced with LFNST as an example ofnon-separable transform (e.g., LFNST) using a non-square transformmatrix having a reduced input length and/or a reduced output length in asquare non-separable transform matrix applied to an at least a region(4×4 or 8×8 left top region or a region other than a 4×4 right bottomregion in an 8×8 block) of a transform block.

TABLE 7 intra mode 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 NSST Set 0 02 2 2 2 2 2 2 2 2 2 2 18 18 18 16 intra mode 17 18 19 20 21 22 23 24 2526 27 28 29 30 31 32 33 NSST Set 18 18 18 18 18 18 18 34 34 34 34 34 3434 34 34 34 intra mode 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 4950 NSST Set 34 34 34 34 34 34 34 34 34 34 34 18 18 18 18 18 18 intramode 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 NSST Set 18 18 1818 18 2 2 2 2 2 2 2 2 2 2 2

The NSST Set number may be rearranged from 0 to 3 as shown in Table 8.

TABLE 8 intra mode 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 NSST Set 0 01 1 1 1 1 1 1 1 1 1 1 2 2 2 2 intra mode 17 18 19 20 21 22 23 24 25 2627 28 29 30 31 32 33 NSST Set 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 intramode 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 NSST Set 3 3 3 33 3 3 3 3 3 3 2 2 2 2 2 2 intra mode 51 52 53 54 55 56 57 58 59 60 61 6263 64 65 66 NSST Set 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1

In the NSST transform set, only four transform sets (instead of 35) areused so that the required memory space can be reduced.

In addition, various numbers of transform kernels per transform set maybe used as follows.

Case A: Two available transform kernels for each transform set are usedso that the NSST index range is from 0 to 2. For example, when the NSSTindex is 0, secondary transform (inverse secondary transform based on adecoder) may not be applied. When the NSST index is 1 or 2, secondarytransform may be applied. The transform set may include two transformkernels to which an index 1 or 2 may be mapped.

TABLE 9 NSST Set 0 1 2 3 (DC, Planar) # of transform kernels 2 2 2 2

Referring to Table 9, two transform kernels are used for each ofnon-separable transform (NSST or LFNST) sets 0 to 3.

Case B: Two available transform kernels are used for transform set 0 andone is used for others. Available NSST indices for transform set 0 (DCand Planar) are 0 to 2. However, NSST indices for other modes (transformsets 1, 2 and 3) are 0 to 1.

TABLE 10 NSST Set 0 1 2 3 (DC, Planar) # of transform kernels 2 1 1 1

Referring to Table 10, two non-separable transform kernels are set for anon-separable transform (NSST) set corresponding to index 0 and onenon-separable transform kernel is set for each of non-separabletransform (NSST) sets corresponding to indices 1, 2 and 3.

Case C: One transform kernel is used per transform kernel and the NSSTindex range is 0 to 1.

TABLE 11 NSST Set 0 1 2 3 (DC, Planar) # of transform kernels 1 1 1 1

FIG. 21 is an exemplary flowchart showing encoding for performingtransform as an embodiment to which the present disclosure is applied.

The encoding apparatus 100 performs primary transform on a residualblock (S2105). The primary transform may be referred to as coretransform. As an embodiment, the encoding apparatus 100 may perform theprimary transform using the above-mentioned MTS. Further, the encodingapparatus 100 may transmit an MTS index indicating a specific MTS fromamong MTS candidates to the decoding apparatus 200. Here, the MTScandidates may be configured on the basis of the intra-prediction modeof the current block.

The encoding apparatus 100 determines whether to apply secondarytransform (S2110). For example, the encoding apparatus 100 may determinewhether to apply the secondary transform on the basis of transformcoefficients of the primarily transformed residual block. For example,the secondary transform may be NSST or RST.

The encoding apparatus 100 determines the secondary transform (S2115).Here, the encoding apparatus 100 may determine the secondary transformon the basis of an NSST (or RST) transform set designated according tothe intra-prediction mode.

For example, the encoding apparatus 100 may determine a region to whichthe secondary transform will be applied on the basis of the size of thecurrent block prior to step S2115.

The encoding apparatus 100 performs the secondary transform determinedin step S2115 (S2120).

FIG. 22 is an exemplary flowchart showing decoding for performingtransform as an embodiment to which the present disclosure is applied.

The decoding apparatus 200 determines whether to apply inverse secondarytransform (S2205). For example, the inverse secondary transform may beNSST or RST. For example, the decoding apparatus 200 may determinewhether to apply the inverse secondary transform on the basis of asecondary transform flag received from the encoding apparatus 100.

The decoding apparatus 200 determines the inverse secondary transform(S2210). Here, the decoding apparatus 200 may determine the inversesecondary transform applied to the current block on the basis of theNSST (or RST) transform set designated according to the aforementionedintra-prediction mode.

Further, for example, the decoding apparatus 200 may determine a regionto which the inverse secondary transform will be applied on the basis ofthe size of the current block prior to step S2210.

The decoding apparatus 200 performs inverse secondary transform on aninversely quantized residual block using the inverse secondary transformdetermined in step S2210 (S2215).

The decoding apparatus performs inverse primary transform on theinversely secondarily transformed residual block (S2220). The inverseprimary transform may be called inverse core transform. In anembodiment, the decoding apparatus 200 may perform the inverse primarytransform using the aforementioned MTS. Further, as an example, thedecoding apparatus 200 may determine whether MTS is applied to thecurrent block prior to step S2220. In this case, the decoding flowchartof FIG. 22 may further include a step of determining whether MTS isapplied.

For example, when MTS is applied to the current block (i.e.,cu_mts_flag=1), the decoding apparatus 200 may configure MTS candidateson the basis of the intra-prediction mode of the current block. In thiscase, the decoding flowchart of FIG. 22 may further include a step ofconfiguring MTS candidates. In addition, the decoding apparatus 200 maydetermine inverse primary transform applied to the current block usingmtx_idx indicating a specific MTS from among the configured MTScandidates.

FIG. 23 is a detailed block diagram of the transform unit 120 in theencoding apparatus 100 as an embodiment to which the present disclosureis applied.

The encoding apparatus 100 to which an embodiment of the presentdisclosure is applied may include a primary transform unit 2310, asecondary transform application determination unit 2320, a secondarytransform determination unit 2330, and a secondary transform unit 2340.

The primary transform unit 2310 can perform primary transform on aresidual block. The primary transform may be referred to as coretransform. As an embodiment, the primary transform unit 2310 may performthe primary transform using the above-mentioned MTS. Further, theprimary transform unit 2310 may transmit an MTS index indicating aspecific MTS from among MTS candidates to the decoding apparatus 200.Here, the MTS candidates may be configured on the basis of theintra-prediction mode of the current block.

The secondary transform application determination unit 2320 candetermine whether to apply secondary transform. For example, thesecondary transform application determination unit 2320 may determinewhether to apply the secondary transform on the basis of transformcoefficients of the primarily transformed residual block. For example,the secondary transform may be NSST or RST.

The secondary transform determination unit 2330 determines the secondarytransform. Here, the secondary transform determination unit 2330 maydetermine the secondary transform on the basis of an NSST (or RST)transform set designated according to the intra-prediction mode asdescribed above.

For example, the secondary transform determination unit 2330 maydetermine a region to which the secondary transform will be applied onthe basis of the size of the current block.

The secondary transform unit 2340 can perform the determined secondarytransform.

FIG. 24 is a detailed block diagram of the inverse transform unit 230 inthe decoding apparatus 200 as an embodiment to which the presentdisclosure is applied.

The decoding apparatus 200 to which the present disclosure is appliedincludes an inverse secondary transform application determination unit2410, an inverse secondary transform determination unit 2420, an inversesecondary transform unit 2430, and an inverse primary transform unit2440.

The inverse secondary transform application determination unit 2410 candetermine whether to apply inverse secondary transform. For example, theinverse secondary transform may be NSST or RST. For example, the inversesecondary transform application determination unit 2410 may determinewhether to apply the inverse secondary transform on the basis of asecondary transform flag received from the encoding apparatus 100.

The inverse secondary transform determination unit 2420 can determinethe inverse secondary transform. Here, the inverse secondary transformdetermination unit 2420 may determine the inverse secondary transformapplied to the current block on the basis of the NSST (or RST) transformset designated according to the intra-prediction mode.

Further, for example, the inverse secondary transform determination unit2420 may determine a region to which the inverse secondary transformwill be applied on the basis of the size of the current block.

The inverse secondary transform unit 2430 can perform inverse secondarytransform on an inversely quantized residual block using the determinedinverse secondary transform.

The inverse primary transform unit 2440 can perform inverse primarytransform on the inversely secondarily transformed residual block. In anembodiment, the inverse primary transform unit 2440 may perform theinverse primary transform using the aforementioned MTS. Further, as anexample, the inverse primary transform unit 2440 may determine whetherMTS is applied to the current block.

For example, when MTS is applied to the current block (i.e.,cu_mts_flag=1), the inverse primary transform unit 2440 may configureMTS candidates on the basis of the intra-prediction mode of the currentblock. In addition, the inverse primary transform unit 2440 maydetermine inverse primary transform applied to the current block usingmtx_idx indicating a specific MTS from among the configured MTScandidates.

FIG. 25 is a flowchart for processing a video signal as an embodiment towhich the present disclosure is applied. The process of the flowchart ofFIG. 25 can be executed by the decoding apparatus 200 or the inversetransform unit 230.

First, the decoding apparatus 200 can determine whether reversenon-separable transform is applied to the current block on the basis ofa non-separable transform index and the width and height of the currentblock. For example, if the non-separable transform index is not 0 andthe width and height of the current block are equal to or greater than4, the decoding apparatus 200 can determine that the non-separabletransform is applied. If the non-separable transform index is 0 or thewidth or the height of the current block is less than 4, the decodingapparatus 200 can omit the reverse non-separable transform and performinverse primary transform.

In step S2505, the decoding apparatus 200 determines a non-separabletransform set index indicating a non-separable transform set used fornon-separable transform of the current block from among non-separabletransform sets predefined on the basis of the intra-prediction mode ofthe current block. A non-separable transform set index can be set suchthat it is allocated to each of four transform sets configured accordingto the range of the intra-prediction mode, as shown in Table 7 or Table8. That is, the non-separable transform set index can be determined as afirst index value when the intra-prediction mode is 0 and 1, determinedas a second index value when the intra-prediction mode is 2 to 12 or 56to 66, determined as a third index value when the intra-prediction modeis 13 to 23 or 45 to 55, and determined as a fourth index value when theintra-prediction mode is 24 to 44, as shown in Table 7 or Table 8.

Here, each of the predefined non-separable transform sets may includetwo transform kernels, as shown in Table 9. Further, each of thepredefined non-separable transform sets may include one or two transformkernels, as shown in Table 10 or 11.

In step S2510, the decoding apparatus 200 determines, as a non-separabletransform matrix, a transform kernel indicated by the non-separabletransform index for the current block from among transform kernelsincluded in the non-separable transform set indicated by thenon-separable transform set index. For example, two non-separabletransform kernels may be configured for each non-separable transform setindex value and the decoding apparatus 200 may determine a non-separabletransform matrix on the basis of the transform kernel indicated by thenon-separable transform index between two transform matrix kernelscorresponding to the non-separable transform set index.

In step S2515, the decoding apparatus 200 applies the non-separabletransform matrix to a left top region of the current block determined onthe basis of the width and height of the current block. For example,non-separable transform may be applied to an 8×8 left top region of thecurrent block if both the width and height of the current block areequal to or greater than 8 and non-separable transform may be applied toa 4×4 region of the current block if the width or height of the currentblock is less than 8. The size of non-separable transform may also beset to a size (e.g. 48×16, 16×16) corresponding to 8×8 or 4×4 inresponse to a region to which non-separable transform will be applied.

Furthermore, the decoding apparatus 200 may apply horizontal transformand vertical transform to the current block to which non-separabletransform has been applied. Here, the horizontal transform and verticaltransform may be determined on the basis of an MTS index for selectionof the prediction mode and transform matrix applied to the currentblock.

Hereinafter, a method of applying a primary transform and a secondarytransform in a combined manner is described. That is, an embodiment ofthe present disclosure proposes a method of efficiently designing atransform used in the primary transform and the secondary transform. Inthis instance, the methods illustrated in FIGS. 1 to 25 can be applied,and the redundant description is omitted.

As described above, the primary transform represents a transform that isfirst applied to a residual block in an encoder. If the secondarytransform is applied, the encoder may perform the secondary transform onthe primary transformed residual block. If the secondary transform wasapplied, a secondary inverse transform may be performed before a primaryinverse transform in a decoder. The decoder may perform the primaryinverse transform on a secondary inverse transformed transformcoefficient block to derive a residual block.

In addition, as described above, a non-separable transform may be usedas the secondary transform, and the secondary transform may be appliedonly to coefficients of a low frequency of a top-left specific region inorder to maintain low complexity. The secondary transform applied tothese coefficients of the low frequency may be referred to as anon-separable secondary transform (NSST), a low frequency non-separabletransform (LFNST), or a reduced secondary transform (RST). The primarytransform may be referred to as a core transform.

In an embodiment of the present disclosure, a primary transformcandidate used in the primary transform and a secondary transform kernelused in the secondary transform may be predefined as variouscombinations. In the present disclosure, the primary transform candidateused in the primary transform may be referred to as a MTS candidate, butis not limited to the name. For example, the primary transform candidatemay be a combination of transform kernels (or transform types)respectively applied to horizontal and vertical directions, and thetransform kernel may be one of DCT2, DST7 and/or DCT8. In other words,the primary transform candidate may be at least one combination of DCT2,DST7 and/or DCT8. The following description is given with detailedexamples.

Combination A

In a combination A, as illustrated in the following Table 12, a primarytransform candidate and a secondary transform kernel may be definedaccording to an intra prediction mode.

TABLE 12 Case 1 2 MTS candidates for angular mode 2 transform kernelsfor angular mode 4 MTS candidates for non-angular 2 transform kernelsfor non-angular mode Case 2 2 MTS candidates for angular mode 1transform kernels for angular mode 4 MTS candidates for non-angular 2transform kernels for non-angular mode Case 3 2 MTS candidates forangular mode 1 transform kernels for angular mode 4 MTS candidates fornon-angular 1 transform kernels for non-angular mode

Referring to the above Table 12, as an example (Case 1), two primarytransform candidates may be used if the intra prediction mode hasdirectionality, and four primary transform candidates may be used if theintra prediction mode has no directionality (e.g., DC mode, planarmode). In this instance, a secondary transform candidate may include twotransform kernels irrespective of the directionality of the intraprediction mode. That is, as described above, a plurality of secondarytransform kernel sets may be predefined according to the intraprediction mode, and each of the plurality of predefined secondarytransform kernel sets may include two transform kernels.

Further, as an example (Case 2), two primary transform candidates may beused if the intra prediction mode has directionality, and four primarytransform candidates may be used if the intra prediction mode has nodirectionality. In this instance, a secondary transform candidate mayinclude one transform kernel if the intra prediction mode hasdirectionality, and a secondary transform candidate may include twotransform kernels if the intra prediction mode has no directionality.

Further, as an example (Case 3), two primary transform candidates may beused if the intra prediction mode has directionality, and four primarytransform candidates may be used if the intra prediction mode has nodirectionality. In this instance, a secondary transform candidate mayinclude one transform kernel irrespective of the directionality of theintra prediction mode.

Combination B

In a combination B, as illustrated in the following Table 13, a primarytransform candidate and a secondary transform kernel may be definedaccording to an intra prediction mode.

TABLE 13 Case 1 3 MTS candidates for angular mode 2 transform kernelsfor angular mode 3 MTS candidates for non-angular 2 transform kernelsfor non-angular mode Case 2 3 MTS candidates for angular mode 1transform kernels for angular mode 3 MTS candidates for non-angular 2transform kernels for non-angular mode Case 3 3 MTS candidates forangular mode 1 transform kernels for angular mode 3 MTS candidates fornon-angular 1 transform kernels for non-angular mode

Referring to the above Table 13, as an example (Case 1), three primarytransform candidates may be used irrespective of the directionality ofthe intra prediction mode. In this instance, a secondary transformcandidate may include two transform kernels irrespective of thedirectionality of the intra prediction mode. That is, as describedabove, a plurality of secondary transform kernel sets may be predefinedaccording to the intra prediction mode, and each of the plurality ofpredefined secondary transform kernel sets may include two transformkernels.

Further, as an example (Case 2), three primary transform candidates maybe used irrespective of the directionality of the intra prediction mode.In this instance, a secondary transform candidate may include onetransform kernel if the intra prediction mode has directionality, andthe secondary transform candidate may include two transform kernels ifthe intra prediction mode has no directionality.

Further, as an example (Case 3), three primary transform candidates maybe used irrespective of the directionality of the intra prediction mode.In this instance, a secondary transform candidate may include onetransform kernel irrespective of the directionality of the intraprediction mode.

Combination C

In a combination C, as illustrated in the following Table 14, a primarytransform candidate and a secondary transform kernel may be definedaccording to an intra prediction mode.

TABLE 14 Primary transform Secondary Transform Case 1 2 MTS candidatesfor angular mode 2 transform kernels for angular mode 3 MTS candidatesfor non-angular 2 transform kernels for non-angular mode Case 2 2 MTScandidates for angular mode 1 transform kernels for angular mode 3 MTScandidates for non-angular 2 transform kernels for non-angular mode Case3 2 MTS candidates for angular mode 1 transform kernels for angular mode3 MTS candidates for non-angular 1 transform kernels for non-angularmode

Referring to the above Table 14, as an example (Case 1), two primarytransform candidates may be used if the intra prediction mode hasdirectionality, and three primary transform candidates may be used ifthe intra prediction mode has no directionality (e.g., DC mode, planarmode). In this instance, a secondary transform candidate may include twotransform kernels irrespective of the directionality of the intraprediction mode. That is, as described above, a plurality of secondarytransform kernel sets may be predefined according to the intraprediction mode, and each of the plurality of predefined secondarytransform kernel sets may include two transform kernels.

Further, as an example (Case 2), two primary transform candidates may beused if the intra prediction mode has directionality, and three primarytransform candidates may be used if the intra prediction mode has nodirectionality. In this instance, a secondary transform candidate mayinclude one transform kernel if the intra prediction mode hasdirectionality, and the secondary transform candidate may include twotransform kernels if the intra prediction mode has no directionality.

Further, as an example (Case 3), two primary transform candidates may beused if the intra prediction mode has directionality, and three primarytransform candidates may be used if the intra prediction mode has nodirectionality. In this instance, a secondary transform candidate mayinclude one transform kernel irrespective of the directionality of theintra prediction mode.

The above description was given focusing on the case of using theplurality of primary transform candidates. The following describescombinations of a primary transform and a secondary transform in case ofusing a fixed primary transform candidate, by way of example.

Combination D

In a combination D, as illustrated in the following Table 15, a primarytransform candidate and a secondary transform kernel may be definedaccording to an intra prediction mode.

TABLE 15 Primary transform Secondary Transform Case 1 1 fixed MTS 2transform kernels candidate for angular mode for all modes 2 transformkernels for non-angular mode Case 2 1 fixed MTS 1 transform kernelscandidate for angular mode for all modes 2 transform kernels fornon-angular mode Case 3 1 fixed MTS 1 transform kernels candidate forangular mode for all modes 1 transform kernels for non-angular mode

Referring to the above Table 15, as an embodiment, one primary transformcandidate may be fixedly used irrespective of the intra prediction mode.For example, the fixed primary transform candidate may be at least onecombination of DCT2, DST7 and/or DCT8.

As an example (Case 1), one primary transform candidate may be fixedlyused irrespective of the intra prediction mode. In this instance, asecondary transform candidate may include two transform kernelsirrespective of the directionality of the intra prediction mode. Thatis, as described above, a plurality of secondary transform kernel setsmay be predefined according to the intra prediction mode, and each ofthe plurality of predefined secondary transform kernel sets may includetwo transform kernels.

Further, as an example (Case 2), one primary transform candidate may befixedly used irrespective of the intra prediction mode. In thisinstance, a secondary transform candidate may include one transformkernel if the intra prediction mode has directionality, and thesecondary transform candidate may include two transform kernels if theintra prediction mode has no directionality.

Further, as an example (Case 3), one primary transform candidate may befixedly used irrespective of the intra prediction mode. In thisinstance, a secondary transform candidate may include one transformkernel irrespective of the directionality of the intra prediction mode.

Combination E

In a combination E, as illustrated in the following Table 16, a primarytransform candidate and a secondary transform kernel may be definedaccording to an intra prediction mode.

TABLE 16 Primary transform (DCT2 applied) Secondary Transform Case 1DCT2 is applied 2 transform kernels for angular mode 2 transform kernelsfor non-angular mode Case 2 DCT2 is applied 1 transform kernels forangular mode 2 transform kernels for non-angular mode Case 3 DCT2 isapplied 1 transform kernels for angular mode 1 transform kernels fornon-angular mode

Referring to the above Table 16, as long as DCT2 is applied as theprimary transform, a secondary transform may be defined. In other words,if MTS is not applied (i.e., if the DCT2 is applied as the primarytransform), a secondary transform can be applied. As illustrated in FIG.10 above, the present disclosure is described by being divided into acase in which the MTS is applied and a case in which the MTS is notapplied, but is not limited to such an expression. For example, whetheror not the MTS is applied may be the same meaning as whether to use atransform type (or transform kernel) other than a predefined specifictransform type (which may be referred to as a basic transform type, adefault transform type, etc.). If the MTS is applied, a transform type(e.g., any one transform type or a combined transform type of two ormore transform types among a plurality of transform types) other thanthe basic transform type may be used for transform. Further, if the MTSis not applied, the basic transform type may be used for the transform.In an embodiment, the basic transform type may be configured (ordefined) as DCT2.

As an example (Case 1), when the DCT2 is applied to a primary transform,a secondary transform can be applied. In this instance, a secondarytransform candidate may include two transform kernels irrespective ofthe directionality of the intra prediction mode. That is, as describedabove, a plurality of secondary transform kernel sets may be predefinedaccording to the intra prediction mode, and each of the plurality ofpredefined secondary transform kernel sets may include two transformkernels.

Further, as an example (Case 2), when the DCT2 is applied to a primarytransform, a secondary transform can be applied. In this instance, asecondary transform candidate may include one transform kernel if theintra prediction mode has directionality, and the secondary transformcandidate may include two transform kernels if the intra prediction modehas no directionality.

Further, as an example (Case 3), when the DCT2 is applied to a primarytransform, a secondary transform can be applied. In this instance, asecondary transform candidate may include one transform kernelirrespective of the directionality of the intra prediction mode.

FIG. 26 is a flow chart illustrating a method for transforming a videosignal according to an embodiment to which the present disclosure isapplied.

Referring to FIG. 26 , the present disclosure is described based on adecoder for the convenience of the explanation, but is not limitedthereto. A transform method for a video signal according to anembodiment of the disclosure can be substantially equally applied toeven an encoder. The flow chart illustrated in FIG. 26 may be performedby the decoding device 200 or the inverse transform unit 230.

The decoding device 200 parses a first syntax element indicating aprimary transform kernel applied to the primary transform of a currentblock in S2601.

The decoding device 200 determines whether a secondary transform isapplicable to the current block based on the first syntax element inS2602.

If the secondary transform is applicable to the current block, thedecoding device 200 parses a second syntax element indicating asecondary transform kernel applied to the secondary transform of thecurrent block in S2603.

The decoding device 200 derives a secondary inverse-transformed block,by performing a secondary inverse-transform for a top-left specificregion of the current block using the secondary transform kernelindicated by the second syntax element in S2604.

The decoding device 200 derives a residual block of the current block,by performing a primary inverse-transform for the secondaryinverse-transformed block using the primary transform kernel indicatedby the first syntax element in S2605.

As described above, the step S2602 may be performed by determining thatthe secondary transform is applicable to the current block if the firstsyntax element indicates a predefined first transform kernel. In thisinstance, the first transform kernel may be defined as DCT2.

Further, as described above, the decoding device 200 may determine asecondary transform kernel set used for a secondary transform of thecurrent block among predefined secondary transform kernel sets based onan intra prediction mode of the current block. The second syntax elementmay indicate a secondary transform kernel applied to the secondarytransform of the current block in the determined secondary transformkernel set.

Further, as described above, each of the predefined secondary transformkernel sets may include two transform kernels.

In an embodiment of the present disclosure, an example of a syntaxstructure in which a multiple transform set (MTS) is used will bedescribed.

For example, the following table 17 shows an example of a syntaxstructure of a sequence parameter set.

TABLE 17 Descriptor seq_parameter_set_rbsp( ) { sps_seq_parameter_set_idue(v) chroma_format_idc ue(v) if( chroma_format_idc = = 3 ) separate_colour_plane_flag u(1) pic_width_in_luma_samples ue(v)pic_height_in_luma_samples ue(v) bit_depth_luma_minus8 ue(v)bit_depth_chroma_minus8 ue(v) qtbtt_dual_tree_intra_flag ue(v)log2_ctu_size_minus2 ue(v) log2_min_qt_size_intra_slices_minus2 ue(v)log2_min_qt_size_inter_slices_minus2 ue(v)max_mtt_hierarchy_depth_inter_slices ue(v)max_mtt_hierarchy_depth_intra_slices ue(v) sps_cclm_enabled_flag ue(1)sps_mts_intra_enabled_flag ue(1) sps_mts_inter_enabled_flag ue(1)rbsp_trailing_bits( ) }

Referring to Table 17, whether the NTS according to an embodiment of thepresent disclosure can be used may be signaled through a sequenceparameter set syntax. Here, sps_mts_intra_enabled_flag indicatespresence or absence of an MTS flag or an NITS index in a lower levelsyntax (e.g., a residual coding syntax or a transform unit syntax) withrespect to an intra-coding unit. In addition, sps_mts_inter_enabled_flagindicates presence or absence of an MTS flag or an MTS index in a lowerlevel syntax with respect to an inter-coding unit.

As another example, the following table 18 shows an example of atransform unit syntax structure.

TABLE 18 Descriptor    transform_unit( x0, y0, tbWidth, tbHeight,treeType ) {  if ( treeType = = SINGLE_TREE | | treeType = =DUAL_TREE_LUMA )   tu_cbf_luma[ x0 ][ y0 ] ae(v)  if( treeType = =SINGLE_TREE | | treeType = = DUAL_TREE_CHROMA ) {   tu_cbf_cb[ x0 ][ y0] ae(v)   tu_cbf_cr[ x0 ][ y0 ] ae(v)  } if( ( ( ( CuPredMode[ x0 ][ y0] = = MODE_INTRA ) && sps_mts_intra_enabled_flag ) | | ( ( CuPredMode[x0 ][ y0 ] = = MODE_INTER ) && sps_mts_inter_enabled_flag ) )    &&tu_cbf_luma[ x0 ][ y0 ] && treeType ! = DUAL_TREE_CHROMA    && ( tbWidth<= 32 ) && ( tbHeight <= 32 ) )   cu_mts_flag[ x0 ][ y0 ] ae(v)  if(tu_cbf_luma[ x0 ][ y0 ] )   residual_coding( x0, y0, log2( tbWidth ),log2( tbHeight), 0 )  if( tu_cbf_cb[ x0 ][ y0 ] )   residual_coding( x0,y0, log2( tbWidth / 2 ), log2( tbHeight / 2 ), 1 )  if( tu_cbf_cr[ x0 ][y0 ] )   residual_coding( x0, y0, log2( tbWidth / 2 ), log2( tbHeight /2 ), 2 ) }

Referring to Table 18, cu_mts_flag indicates whether MTS is applied to aresidual sample of a luma transform block. For example, MTS is notapplied to the residual sample of the luma transform block ifcu_mts_flag=0, and MTS is applied to the residual sample of the lumatransform block if cu_mts_flag=1.

Although a case in which MTS is applied and a case in which MTS is notapplied based on the MTS flag are separately described in the presentdisclosure, as described above, the present disclosure is not limitedthereto. For example, whether MTS is applied may mean whether atransform type (or transform kernel) other than a predefined specifictransform type (which may be referred to as a basic transform type, adefault transform type, or the like) is used. A transform type (e.g.,any one of a plurality of transform types or a combination of two ormore thereof) other than the default transform type may be used for atransform if MTS is applied, and the default transform type may be usedif MTS is not applied. In an embodiment, the default transform type maybe set (or defined) as DCT2.

For example, an MTS flag syntax indicating whether MTS is applied to acurrent transform block, and an MTS flag syntax indicating a transformtype applied to the current block when MTS is applied can beindividually transmitted from an encoder to a decoder. As anotherexample, a syntax (e.g., MTS index) including both information onwhether MTS is applied to the current transform block and a transformtype applied to the current block when MTS is applied can be transmittedfrom the encoder to the decoder. That is, in the latter embodiment, asyntax (or syntax element) indicating a transform type applied to thecurrent transform block (or unit) in a transform type groups (ortransform type set) including the aforementioned default transform typecan be transmitted from the encoder to the decoder.

Accordingly, the syntax (MTS index) indicating a transform type appliedto the current transform block can include information on whether MTS isapplied despite the expression. In other words, although only the MTSindex can be signaled without the MTS flag in the latter embodiment andthus this case can be interpreted as a case in which MTS includes DCT2,a case in which DCT2 is applied can be described as a case in which MTSis not applied in the present disclosure, but the technical scope withrespect to MTS is not limited thereto.

As another example, the following table 19 shows an example of aresidual unit syntax structure.

TABLE 19 Descriptor  residual_coding( x0, y0, log2TbWidth, log2TbHeight, cIdx ) {  if( transform_skip_enabled_flag &&  ( cIdx ! = 0 | |cu_mts_flag[ x0 ][ y0 ] = = 0 ) &&   ( log2TbWidth <= 2 ) && (log2TbHeight <= 2 ) )   transform_skip_flag[ x0 ][ y0 ][ cIdx ] ae(v) last_sig_coeff_x_prefix ae(v)  last_sig_coeff_y_prefix ae(v)  if(last_sig_coeff_x_prefix > 3 )   last_sig_coeff_x_suffix ae(v)  if(last_sig_coeff_y_prefix > 3 )   last_sig_coeff_y_suffix ae(v) log2SbSize = ( Min( log2TbWidth, log2TbHeight ) <  2 ? 1 : 2 ) numSbCoeff = 1 << ( log2SbSize << 1 )  lastScanPos = numSbCoeff lastSubBlock = ( 1 << (  log2TbWidth + log2TbHeight − 2 * log2SbSize )) − 1  do {   if( lastScanPos = = 0 ) {    lastScanPos = numSbCoeff   lastSubBlock− −   }   lastScanPos− − xS = DiagScanOrder[ log2TbWidth− log2SbSize ] [ log2TbHeight − log2SbSize ]       [ lastSubBlock ][ 0 ]yS = DiagScanOrder[ log2TbWidth − log2SbSize ] [ log2TbHeight −log2SbSize ]      [ lastSubBlock ][ 1 ]   xC = ( xS << log2SbSize ) + DiagScanOrder[ log2SbSize ][ log2SbSize ] [ lastScanPos ][ 0 ]   yC = (yS << log2SbSize ) +  DiagScanOrder[ log2SbSize ][ log2SbSize ] [lastScanPos ][ 1 ]   } while( ( xC != LastSignificantCoeffX ) | | ( yC!= LastSignificantCoeffY ) )  QState = 0  for( i = lastSubBlock; i >= 0;i− − ) {   startQStateSb = QState   xS =  DiagScanOrder[ log2TbWidth −log2SbSize ]  [ log2TbHeight − log2SbSize ]         [ lastSubBlock ][ 0] yS = DiagScanOrder[ log2TbWidth − log2SbSize ] [ log2TbHeight −log2SbSize ]       [ lastSubBlock ][ 1 ]   inferSbDcSigCoeffFlag = 0  if ( i < lastSubBlock ) && ( i > 0 ) ) {    coded_sub_block_flag[ xS][ yS ] ae(v)    inferSbDcSigCoeffFlag = 1   }   firstSigScanPosSb =numSbCoeff   lastSigScanPosSb = −1   for( n = ( i = = lastSubBlock) ?lastScanPos − 1 :  numSbCoeff − 1; n >= 0; n− − ) {    xC = ( xS <<log2SbSize ) +  DiagScanOrder[ log2SbSize ][ log2SbSize ][ n ][ 0 ]   yC = ( yS << log2SbSize ) +  DiagScanOrder[ log2SbSize ][ log2SbSize][ n ][ 1 ]    if( coded_sub_block_flag[ xS ][ yS ] && ( n > 0 | | !inferSbDcSigCoeffFlag ) ) {     sig_coeff_flag[ xC ][ yC ] ae(v)    }   if( sig_coeff_flag[ xC ][ yC ] ) {     par_level_flag[ n ] ae(v)    rem_abs_gt1_flag[ n ] ae(v)     if( lastSigScanPosSb = = −1 )     lastSigScanPosSb = n     firstSigScanPosSb = n    }   AbsLevelPass1[ xC ][ yC ] =      sig_coeff_flag[ xC ][ yC ] +par_level_flag[ n ] + 2 * rem_abs_gt1_flag[ n ]    if(dep_quant_enabled_flag )     QState = QStateTransTable[ QState ] [par_level_flag[ n ] ]   }   for( n = numSbCoeff − 1; n >= 0; n− − ) {   if( rem_abs_gt1_flag[ n ] )     rem_abs_gt2_flag[ n ] ae(v)   }  for( n = numSbCoeff − 1; n >= 0; n− − ) {    xC = ( xS << log2SbSize) +  DiagScanOrder[ log2SbSize ][ log2SbSize ][ n ][ 0 ]    yC = ( yS <<log2SbSize ) +  DiagScanOrder[ log2SbSize ][ log2SbSize ][ n ][ 1 ]   if( rem_abs_gt2_flag[ n ] )     abs_remainder[ n ]    AbsLevel[ xC ][yC ] = AbsLevelPass1[ xC ][ yC ] +         2 * ( rem_abs_gt2_flag[ n ] +abs_remainder[ n ] )   }   if( dep_quant_enabled_flag | | !sign_data_hiding_enabled_flag )    signHidden = 0   else    signHidden= ( lastSigScanPosSb − firstSigScanPosSb > 3 ? 1 : 0 )   for( n =numSbCoeff − 1; n >= 0; n− − ) {    xC = ( xS << log2SbSize ) + DiagScanOrder[ log2SbSize ][ log2SbSize ][ n ][ 0 ]    yC = ( yS <<log2SbSize ) +  DiagScanOrder[ log2SbSize ][ log2SbSize ][ n ][ 1 ]   if( sig_coeff_flag )[ xC ][ yC ] &&     ( !signHidden | | ( n !=firstSigScanPosSb ) ) )     coeff_sign_flag[ n ] ae(v)   }   if(dep_quant_enabled_flag ) {    QState = startQStateSb    for( n =numSbCoeff − 1; n >= 0; n− − ) {     xC = ( xS << log2SbSize ) +      DiagScanOrder[ log2SbSize ][ log2SbSize ] [ n ][ 0 ]     yC = ( yS<< log2SbSize ) +       DiagScanOrder[ log2SbSize ][ log2SbSize ] [ n ][1 ]     if( sig_coeff_flag[ xC ][ yC ] )      TransCoeffLevel[ x0 ][ y0][ cIdx ][ xC ] [ yC ] =        ( 2 * AbsLevel[ xC ][ yC ] − ( QState >1 ? 1 : 0 ) ) *        ( 1 − 2 * coeff_sign _flag[ n ] )     QState =QStateTransTable[ QState ] [ par_level_flag[ n ] ]   } else {   sumAbsLevel = 0    for( n = numSbCoeff − 1; n >= 0; n− − ) {     xC =( xS << log2SbSize ) +       DiagScanOrder[ log2SbSize ][ log2SbSize ] [n ][ 0 ]     yC = ( yS << log2SbSize ) +       DiagScanOrder[ log2SbSize][ log2SbSize ] [ n ][ 1 ]     if( sig_coeff_flag[ xC ][ yC ] ) {     TransCoeffLevel[ x0 ][ y0 ][ cIdx ][ xC ] [ yC ] =        AbsLevel[xC ][ yC ] * ( 1 − 2 * coeff_sign_flag[ n ] )      if( signHidden ) {      sumAbsLevel += AbsLevel[ xC ][ yC ]       if( ( n = =firstSigScanPosSb ) &&  ( sumAbsLevel % 2 ) = = 1 ) )       TransCoeffLevel[ x0 ][ y0 ][ cIdx ][ xC ] [ yC ] = −TransCoeffLevels[ x0 ][ y0 ][ cIdx ][ xC ][ yC ]      }     }    }   } }  if( cu_mts_flag[ x0 ][ y0 ] && ( cIdx = = 0 ) &&  !transform_skip_flag[ x0 ][ y0 ][ cIdx ] &&  ( ( CuPredMode[ x0 ][ y0] = = MODE_INTRA &&  numSigCoeff > 2 ) | |   ( CuPredMode[ x0 ][ y0 ] == MODE_INTER ) ) ) {   mts_idx[ x0 ][ y0 ] ae(v)  }

Referring to Table 19, transform_skip_flag and/or mts_idx syntax (orsyntax element) can be signaled through a residual syntax. However, thisis merely an example and the present disclosure is not limited thereto.For example, transform_skip_flag and/or mts_idx syntax may be signaledthrough a transform unit syntax.

Hereinafter, a method for improving complexity by applying primarytransform only to a predefined region is proposed. When combinations ofvarious transforms (or transform kernels) such as MTS (e.g., DCT2, DST7,DCT8, DST1, DCT5, etc.) are selectively applied to primary transform,complexity may increase. Particularly, various transforms need to beconsidered as a coding block (or transform block) size increases, whichmay considerably increase complexity.

Accordingly, in an embodiment of the present disclosure, a method forperforming a transform only on a predefined region according to specificconditions instead of performing the transform on (or applying to) allregions in order to reduce complexity is proposed.

As an embodiment, an encoder may obtain an R×R transform block insteadof an M×M transform block by applying forward primary transform to anM×M pixel block based on the reduced transform (RT) method describedabove with respect to FIGS. 16 to 24 . For example, an R×R region may bea top-left R×R region in a current block (coding block or transformblock). A decoder may obtain an M×M pixel block or transform block byperforming inverse primary transform only on an R×R (M≥R) region.

Consequently, non-zero coefficients may be present only in the R×Rregion. In this case, the decoder can zero-out coefficients present inregions other than the R×R region without performing calculationtherefor. The encoder can perform forward transform such that only theR×R region remains (such that non-zero coefficients are present only inthe R×R region).

Further, the decoder may apply primary transform (i.e., reversetransform) only to a predefined region determined according to the sizeof a coding block (or transform block) and/or transform (or transformkernel) type. The following table 20 shows Reduced Adaptive MultipleTransform (RAMT) using a predefined R value (which may be referred to asa reduced factor, a reduced transform factor, or the like) depending onthe size of a transform (or the size of a transform block). In thepresent disclosure, Reduced Adaptive Multiple Transform (RAMT)representing reduced transform adaptively determined depending on ablock size may be referred to as Reduced MTS (Multiple TransformSelection), Reduced explicit multiple transform. Reduced primarytransform, and the like.

TABLE 20 Transform Reduced Reduced Reduced size transform 1 transform 2transform 3 8 × 8 4 × 4 6 × 6 6 × 6 16 × 16 8 × 8 12 × 12 8 × 8 32 × 3216 × 16 16 × 16 16 × 16 64 × 64 32 × 32 16 × 16 16 × 16 128 × 128 32 ×32 16 × 16 16 × 16

Referring to Table 20, at least one reduced transform can be defineddepending on a transform size (or transform block size). In anembodiment, which reduced transform among reduced transforms shown inTable 20 will be used may be determined according to a transform (ortransform kernel) applied to a current block (coding block or transformblock). Although a case in which three reduced transforms are used isassumed in Table 20, the present disclosure is not limited thereto andone or more various reduced transforms may be predefined depending ontransform sizes.

Further, in an embodiment of the present disclosure, a reduced transformfactor (R) may be determined depending on primary transform inapplication of the aforementioned reduced adaptive multiple transform.For example, when the primary transform is DCT2, coding performancedeterioration can be minimized by not using reduced transform for asmall block or by using a relatively large R value because thecomputational complexity of DCT2 is lower than those of other primarytransforms (e.g., a combination of DST7 and/or DCT8). The followingtable 21 shows Reduced Adaptive Multiple Transform (RAMT) using apredefined R value depending on a transform size (or transform blocksize) and a transform kernel.

TABLE 21 Reduced Reduced Transform transform transform size for DCT2except DCT2 8 × 8 8 × 8 4 × 4 16 × 16 16 × 16 8 × 8 32 × 32 32 × 32 16 ×16 64 × 64 32 × 32 32 × 32 128 × 128 32 × 32 32 × 32

Referring to Table 21, in a case in which a transform applied as primarytransform is DCT2 and a case in which the transform applied as primarytransform is a transform except DCT2 (e.g., a combination of DST7 and/orDCT8), different reduced transform factors can be used.

FIG. 27 is a diagram illustrating a method for encoding a video signalusing reduced transform as an embodiment to which the present disclosureis applied.

Referring to FIG. 27 , an encoder determines whether to apply atransform to a current block (S2701). The encoder may encode a transformskip flag according to a determination result. In this case, the step ofencoding the transform skip flag may be included in step S2701.

When the transform is applied to the current block, the encoderdetermines a transform kernel applied to primary transform of thecurrent block (S2702). The encoder may encode a transform indexindicating the determined transform kernel. In this case, the step ofencoding the transform index may be included in step S2702.

The encoder determines a region in which a significant coefficient ispresent within the current block based on the transform kernel appliedto the primary transform of the current block and the size of thecurrent block (S2703).

As an embodiment, the encoder may determine a region having a widthand/or a height corresponding to a predefined size as the region inwhich the significant coefficient is present when the transform kernelindicated by the transform index are a predefined transform and thewidth and/or the height of the current block are greater than thepredefined size.

For example, the predefined transform may be one of a plurality oftransform combinations of DST7 and/or DCT8, and the predefined size maybe 16. Alternatively, the predefined transform may be a transform exceptDCT2. As an example, the encoder may determine a region having a widthand/or a height of 32 as the region to which the primary transform isapplied when the transform kernel indicated by the transform index isDCT2 and the width and/or the height of the current block are greaterthan 32.

Further, as an embodiment, the encoder may determine a smaller valuebetween the width of the current block and a first threshold value asthe width of the region to which the primary transform is applied anddetermine a smaller value between the height of the current block andthe first threshold value as the height of the region in which thesignificant coefficient is present when the transform kernel indicatedby the transform index belongs to a first transform group. For example,the first threshold value may be 32, but the present disclosure is notlimited thereto and the first threshold value may be 4, 8, or 16 asshown in Table 20 or Table 21.

In addition, the encoder may determine a smaller value between the widthof the current block and a second threshold value as the width of theregion to which the primary transform is applied and determine a smallervalue between the height of the current block and the second thresholdvalue as the height of the region in which the significant coefficientis present when the transform kernel indicated by the transform indexbelongs to a second transform group. For example, the second thresholdvalue may be 16, but the present disclosure is not limited thereto andthe second threshold value may be 4, 6, 8, 12, or 32 as shown in Table20 or Table 21.

As an embodiment, the first transform group may include DCT2 and thesecond transform group may include a plurality of transform combinationsof DST7 and/or DCT8.

The encoder performs forward primary transform using the transformkernel applied to the primary transform of the current block (S2704).The encoder can obtain primarily transformed transform coefficients inthe region in which the significant coefficient is present by performingthe forward primary transform. As an embodiment, the encoder may applysecondary transform to the primarily transformed transform coefficients.In this case, the methods described above with reference to FIG. 6 toFIG. 26 can be applied.

FIG. 28 is a diagram illustrating a method for decoding a video signalusing reduced transform as an embodiment to which the present disclosureis applied.

A decoder checks whether transform skip is applied to a current block(S2801).

When transform skip is not applied to the current block, the decoderobtains a transform index indicating a transform kernel applied to thecurrent block from a video signal (S2802).

The decoder determines a region in which primary transform (i.e.,primary inverse transform) is applied to the current block based on thetransform kernel indicated by the transform index and the size (i.e.,the width and/or the height) of the current block (S2803).

As an embodiment, the decoder may set coefficients of the remainingregion except the region to which the primary transform is applied as 0.

In addition, as an embodiment, when the transform kernel indicated bythe transform index is a predefined transform and the width and/or theheight of the current block are greater than a predefined size, thedecoder may determine a region having a width and/or a heightcorresponding to the predefined size as the region to which the primarytransform is applied.

For example, the predefined transform may be any one of a plurality oftransform combinations of DST7 and/or DCT8, and the predefined size maybe 16. Alternatively, the predefined transform may be a transform exceptDCT2. For example, when the transform kernel indicated by the transformindex is DCT and the width and/or the height of the current block aregreater than 32, the decoder may determine a region having a widthand/or a height of 32 as the region to which the primary transform isapplied.

Furthermore, as an embodiment, the decoder may determine a smaller valuebetween the width of the current block and a first threshold value asthe width of the region to which the primary transform is applied anddetermine a smaller value between the height of the current block andthe first threshold value as the height of the region to which theprimary transform is applied when the transform kernel indicated by thetransform index belongs to a first transform group. For example, thefirst threshold value may be 32, but the present disclosure is notlimited thereto and the first threshold value may be 4, 8, or 16 asshown in Table 20 or Table 21.

In addition, the decoder may determine a smaller value between the widthof the current block and a second threshold value as the width of theregion to which the primary transform is applied and determine a smallervalue between the height of the current block and the second thresholdvalue as the height of the region to which the primary transform isapplied is present when the transform kernel indicated by the transformindex belongs to a second transform group. For example, the secondthreshold value may be 16, but the present disclosure is not limitedthereto and the second threshold value may be 4, 6, 8, 12, or 32 asshown in Table 20 or Table 21.

As an embodiment, the first transform group may include DCT2 and thesecond transform group may include a plurality of transform combinationsof DST7 and/or DCT8.

The decoder performs inverse primary transform on the region to whichthe primary transform is applied using the transform kernel indicated bythe transform index (S2804). The decoder can obtain primarily inverselytransformed transform coefficients by performing the inverse primarytransform. As an embodiment, the decoder may apply secondary transformto inversely quantized transform coefficients prior to the primarytransform. In this case, the methods described above with reference toFIG. 6 to FIG. 26 may be applied.

According to the embodiments of the present disclosure, it is possibleto considerably reduce worst case complexity by performing a transformonly on a predefined region according to specific conditions.

In addition, in an embodiment of the present disclosure, when the MTS(EMT or AMT) flag is 0 (i.e., when DCT-2 transform is applied in boththe horizontal (lateral) direction and the vertical (longitudinal)direction), the encoder/decoder can perform zero-out for high frequencycomponents (i.e., derive or set the high frequency components as 0)except 32 top-left coefficients in the horizontal and verticaldirections. Although the present embodiment is referred to as a firstembodiment for convenience of description in embodiments which will bedescribed later, embodiments of the present disclosure are not limitedthereto.

For example, in the case of a 64×64 TU (or CU), the encoder/decoder cankeep transform coefficients only for a top-left 32×32 region and performzero-out for coefficients of the remaining region. Further, in the caseof a 64×16 TU, the encoder/decoder can keep transform coefficients onlyfor a top-left 32×16 region and perform zero-out for coefficients of theremaining region. In addition, in the case of an 8×64 TU, theencoder/decoder can keep transform coefficients only for a top-left 8×32region and perform zero-out for coefficients of the remaining region.That is, transform coefficients can be set such that transformcoefficients are present only for a maximum length of 32 in both thehorizontal and vertical directions, which can improve transformefficiency.

As an embodiment, such a zero-out method may be applied to only aresidual signal to which intra-prediction is applied, applied to only aresidual signal to which inter-prediction is applied, or applied to botha residual signal to which intra-prediction is applied and a residualsignal to which inter-prediction is applied.

In addition, in an embodiment of the present disclosure, when the MTSflag is 1 (i.e., when a transform (e.g., DST-7 or DCT-8) other thanDCT-2 transform is applied in the horizontal direction and the verticaldirection), the encoder/decoder can perform zero-out for high frequencycomponents (i.e., derive or set the high frequency components as 0)except coefficients of a specific top-left region. Although the presentembodiment is referred to as a second embodiment for convenience ofdescription in embodiments which will be described later, embodiments ofthe present disclosure are not limited thereto.

As an embodiment, the encoder/decoder may keep only a transformcoefficient region corresponding to a part of the top-left region as inthe following examples. That is, the encoder/decoder can preset thelength (or number) of transform coefficients in the horizontal and/orvertical directions to which primary transform is applied depending on awidth and/or a height. For example, coefficients out of the length towhich primary transform is applied can be zero-out.

-   -   When the width (w) is equal to or greater than 2^(n), transform        coefficients only for a length of w/2^(p) from the left side may        be kept and transform coefficients of the remaining region may        be fixed (or set) to 0 (zero-out).    -   When the height (h) is equal to or greater than 2^(m), transform        coefficients only for a length of h/2^(q) from the top may be        kept and transform coefficients of the remaining region may be        fixed to 0.

For example, the values m, n, p, and q may be predefined as variousvalues. For example, the values m, n, p, and q may be set to integervalues equal to or greater than 0. Alternatively, they may be set as inthe following examples.

1) (m, n, p, q)=(5, 5, 1, 1)

2) (m, n, p, q)=(4, 4, 1, 1)

When the configuration of 1) is predefined, for example, transformcoefficients may be kept only for a top-left 16×16 region with respectto a 32×16 TU, and transform coefficients may be kept only for atop-left 8×16 region with respect to an 8×32 TU.

As an embodiment, such a zero-out method may be applied to only aresidual signal to which intra-prediction is applied, applied to only aresidual signal to which inter-prediction is applied, or applied to botha residual signal to which intra-prediction is applied and a residualsignal to which inter-prediction is applied.

In another embodiment of the present disclosure, when the MTS flag is 1(i.e., when a transform (e.g., DST-7 or DCT-8) other than DCT-2transform is applicable in the horizontal direction and the verticaldirection), the encoder/decoder can perform zero-out for high frequencycomponents (i.e., derive or set the high frequency components as 0)except coefficients of a specific top-left region. More specifically,the encoder can keep the coefficients of the specific top-left regionand perform zero-out for the remaining high frequency components, andthe decoder can recognize the zero-out region in advance and performdecoding using the coefficients of the non-zero-out region. However,embodiments of the present disclosure are not limited thereto, and thezero-out process from the viewpoint of the decoder can be understood asa process of deriving (recognizing or setting) the zero-out region as 0.Although the present embodiment is referred to as a third embodiment forconvenience of description in embodiments which will be described later,embodiments of the present disclosure are not limited thereto.

As an embodiment, the encoder/decoder may keep only a transformcoefficient region corresponding to a part of the top-left region as inthe following examples. That is, the encoder/decoder can preset thelength (or number) of transform coefficients in the horizontal and/orvertical directions to which primary transform is applied depending on awidth and/or a height. For example, coefficients out of the length towhich primary transform is applied can be zero-out.

-   -   When the height (h) is equal to or greater than the width (w)        and equal to or greater than 2^(n), transform coefficients of        only a top-left region wx(h/2^(p)) may be kept and transform        coefficients of the remaining region may be fixed (or set) to 0        (zero-out).    -   When the width (w) is greater than the height (h) and equal to        or greater than 2^(m), transform coefficients of only a top-left        region (w/2^(q))×h may be kept and transform coefficients of the        remaining region may be fixed to 0.

Although the length in the vertical direction is reduced (h/2^(p)) whenthe height (h) equals the width (w) in the above-described example, thelength in the horizontal direction may be reduced (w/2^(q)).

For example, the values m, n, p, and q may be predefined as variousvalues. For example, the values m, n, p, and q may be set to integervalues equal to or greater than 0. Alternatively, they may be set as inthe following examples.

1) (m, n, p, q)=(4, 4, 1, 1)

2) (m, n, p, q)=(5, 5, 1, 1)

When the configuration of 1) is predefined, for example, transformcoefficients may be kept only for a top-left 16×16 region with respectto a 32×16 TU, and transform coefficients may be kept only for atop-left 8×8 region with respect to an 8×16 TU.

As an embodiment, such a zero-out method may be applied to only aresidual signal to which intra-prediction is applied, applied to only aresidual signal to which inter-prediction is applied, or applied to botha residual signal to which intra-prediction is applied and a residualsignal to which inter-prediction is applied.

The first embodiment pertaining to a method of limiting a transformcoefficient region when the MTS flag is 0, and the second and thirdembodiments pertaining to a method of limiting a transform coefficientregion when the MTS flag is 1 may be individually applied or may beapplied in a combined manner.

As an embodiment, configurations combined as follows may be applied.

1) First embodiment+second embodiment

2) First embodiment+third embodiment

As mentioned in the second and third embodiments, the zero-out methodmay be applied to only a residual signal to which intra-prediction isapplied, applied to only a residual signal to which inter-prediction isapplied, or applied to both a residual signal to which intra-predictionis applied and a residual signal to which inter-prediction is applied asan embodiment. Accordingly, configurations combined as follows may beapplied to a case in which the MTS flag is 1. Here, the first embodimentmay be applied to a case in which the MTS flag is 0.

TABLE 22 Config. Intra-prediction Inter-prediction index residual signalresidual signal 1 Zero-out is not Zero-out is not applied applied 2Zero-out is not First embodiment applied 3 Zero-out is not Secondembodiment applied 4 First embodiment Zero-out is not applied 5 Firstembodiment First embodiment 6 First embodiment Second embodiment 7Second embodiment Zero-out is not applied 8 Second embodiment Firstembodiment 9 Second embodiment Second embodiment

In an embodiment of the present disclosure, the encoder/decoder may notperform residual coding for a region regarded as a region havingtransform coefficients of 0 according to zero-out. That is, theencoder/decoder can be defined such that they perform residual codingonly for regions other than zero-out regions.

In the above-described first, second and third embodiments, a region (orcoefficient) that needs to have a value of 0 is obviously determined.That is, regions other than the top-left region in which presence oftransform coefficients is permitted are zero-out. Accordingly, in anentropy coding (or residual coding) process, the encoder/decoder may beconfigured to bypass a region guaranteed to have a value of 0 withoutperforming residual coding thereon.

In an embodiment, the encoder/decoder may code a flag (referred to assubblock_flag) (or a syntax, or a syntax element) indicating presence orabsence of a non-zero transform coefficient in a coefficient group (CG).Here, the CG is a subblock of a TU and may be set to a 4×4 or 2×2 blockaccording to the shape of the TU block and/or whether the TU is achroma/luma component.

Here, the encoder/decoder can scan the CG to code coefficient values (orcoefficient level values) only in a case where the subblock_flag is 1.Accordingly, the encoder/decoder may configure CGs belonging to azero-out region such that they have a value of 0 by default withoutperforming subblock_flag coding thereon.

In addition, in an embodiment, the encoder may code a position of a lastcoefficient (or a syntax or a syntax element indicating a position of alast significant coefficient) in forward scanning order first. Forexample, the encoder may code last_coefficient_position_x that is aposition in the horizontal direction and last_coefficient_position_ythat is a position in the vertical direction.

Although maximum values of available values oflast_coefficient_position_x and last_coefficient_position_v may bedetermined as (width −1) and (height −1) of a TU, when a region in whichnon-zero coefficients can be present is limited according to zero-out,the maximum values of available values of last_coefficient_position_xand last_coefficient_position_y may also be limited.

Accordingly, the encoder/decoder may limit the maximum values ofavailable values of last_coefficient_position_x andlast_coefficient_position_y in consideration of zero-out and then codethem. For example, when a binarization method applied tolast_coefficient_position_x and last_coefficient_position_y is atruncated unary (or truncated Rice (TR), or truncated binary (TB))binarization method, the encoder/decoder can control (reduce) a maximumlength of truncated unary code such that it corresponds to adjustedmaximum values (i.e., available maximum values oflast_coefficient_position_x and last_coefficient_position_y).

Although some of the above-described embodiments of the presentdisclosure have been classified for convenience of description, thepresent disclosure is not limited thereto. That is, the above-describedembodiments may be independently performed or one or more embodimentsmay be performed in a combined manner.

FIG. 29 is a flowchart illustrating a method for decoding a video signalbased on reduced transform according to an embodiment of the presentdisclosure.

Referring to FIG. 29 , although description is based on the decoder forconvenience, the present disclosure is not limited thereto and a methodfor converting a video signal according to the present embodiment can besubstantially equally applied to the encoder. The flowchart of FIG. 29can be performed by the decoding apparatus 200 or the inverse transformunit 230.

The decoder obtains a transform index indicating transform kernelsapplied to a current block in the horizontal and vertical direction fromthe video signal (S2901).

The decoder determines a region in which a transform (i.e., inversetransform) is applied to the current block based on the transformkernels indicated by the transform index and the size of the currentblock (S2902).

The decoder sets, as 0, coefficients of the remaining region other thanthe region to which the transform is applied within the current block(S2903).

The decoder performs an inverse transform on the region to which thetransform is applied using the transform kernels indicated by thetransform index (S2904).

As described above, in determination of the region to which thetransform is applied, when the transform kernels indicated by thetransform index are a predefined transform, and the width and/or theheight of the current block are greater than a predefined size, a regionhaving a width and/or a height corresponding to the predefined size maybe determined as the region to which the transform is applied.

As described above, the predefined transform may be any one of aplurality of transform combinations of DST7 and/or DCT8.

As described above, the predefined size may be 16.

As described above, in determination of the region to which thetransform is applied, a smaller value between the width of the currentblock and 32 may be determined as the width of the region to which thetransform is applied and a smaller value between the height of thecurrent block and 32 may be determined as the height of the region towhich the transform is applied when the transform kernels indicated bythe transform index belong to a first transform group, and a smallervalue between the width of the current block and 16 may be determined asthe width of the region to which the transform is applied and a smallervalue between the height of the current block and 16 may be determinedas the height of the region to which the transform is applied when thetransform kernels indicated by the transform index belong to a secondtransform group. As an embodiment, the first transform group may includeDCT2, and the second transform group may include a plurality oftransform combinations of DST7 and/or DCT8.

As described above, the method may further include a step of obtaining asyntax element indicating a position of a last significant coefficientin scanning order within the current block, and coefficients to whichthe inverse transform is applied may be obtained from the video signalbased on the position of the last significant coefficient.

As described above, the syntax element may be binarized according to atruncated unary method, and a maximum value of the syntax element may bedetermined based on the region set as 0.

FIG. 30 is a flowchart illustrating a method for decoding a video signalaccording to an embodiment of the present disclosure.

Referring to FIG. 30 , although description will be based on a decoderfor convenience, the present disclosure is not limited thereto and amethod for converting a video signal according to the present embodimentcan be substantially equally applied to an encoder. The flowchart ofFIG. 30 can be executed by the decoding apparatus 200 or the inversetransform unit 230.

The decoder checks whether a transform skip is applied to a currentblock (S3001).

When the transform skip is not applied to the current block, the decoderobtains a transform index indicating a transform type set applied to thecurrent block from the video signal (S3002). Here, the transform typeset may include transform types applied to the current block in thehorizontal and vertical directions.

The decoder checks whether the transform type set includes DCT2 (S3003).

The decoder determines a region to which a primary transform is appliedbased on a checking result (S3004).

The decoder performs inverse transform on the region to which theprimary transform is applied in the horizontal and vertical directionsusing the transform types included in the transform type set (S3005).

As described above, the decoder may derive coefficients of a regionother than the region to which the primary transform is applied as 0within the current block.

As described above, when the transform type set includes DCT2, the widthof the region to which the primary transform is applied may bedetermined as a smaller value between the width of the current block and32 and the height of the region to which the primary transform isapplied may be determined as a smaller value between the height of thecurrent block and 32.

As described above, when the transform type set is any one of aplurality of transform type sets including combinations of DST7 and/orDCT8, the width of the region to which the primary transform is appliedmay be determined as a smaller value between the width of the currentblock and 16 and the height of the region to which the primary transformis applied may be determined as a smaller value between the height ofthe current block and 16.

As described above, the decoder may obtain a syntax element indicating aposition of a last significant coefficient in scan order within thecurrent block, and coefficients to which the inverse transform isapplied may be obtained from the video signal based on the position ofthe last significant coefficient.

As described above, the syntax element may be binarized according to atruncated unary method, and a maximum length of code for the syntaxelement may be determined based on the region derived as 0.

FIG. 31 is an exemplary block diagram of an apparatus for processing avideo signal as an embodiment to which the present disclosure isapplied. The video signal processing apparatus of FIG. 31 may correspondto an encoding apparatus of FIG. 1 or the decoding apparatus of FIG. 2 .

A video processing apparatus 3100 for processing video signals includesa memory 3120 for storing video signals and a processor 3110 that isconnected to the memory and processes video signals.

The processor 3110 according to an embodiment of the present disclosuremay be configured as at least one processing circuit for video signalprocessing and can process video signals by executing commands for videosignal encoding or decoding. That is, the processor 3110 can encodeoriginal video data or decode encoded video signals by executing theabove-described encoding or decoding methods. Further, the processor1220 may encode original video data or decode encoded video signals byapplying embodiments pertaining to DST7/DCT8 based on discrete Fouriertransform (DFT) which will be described later.

Hereinafter, a method for designing DST7/DCT8 used for transform/inversetransform described with reference to FIG. 6 to FIG. 31 based ondiscrete Fourier transform (DFT) will be described.

FIG. 32 is a flowchart illustrating a design of forward DST7 with alength of 16 using discrete Fourier transform (DFT) as an embodiment towhich the present disclosure is applied.

The present disclosure provides specific embodiments of designing DST7using DFT. The embodiments of the present disclosure can be used forDCT8 design and applied to MTS configuration.

Signals (information) transmitted between blocks shown in the flowchartof FIG. 32 may be scalar values or may have a vector form. For example,a vector may be represented as x[0 . . . N−1] which indicates a signal(information) composed of N elements, such as x[0 . . . N−1]=[x[0] x[1]. . . x[N−2] x[N−1]]. A partial signal of the vector x[0 . . . N−1] maybe represented as x[i . . . j]. For example, a partial signal of x[0 . .. 15] may be represented as x[5 . . . 10]=[x[5]x[6] x[7] x[8] x[9]x[10]].

FIG. 32 shows a flowchart for realizing DST7 for one row or columnhaving a length of 16. Here, DST7 with a length of 16 is represented asDST7_B16, forward DST7 is represented as DST7_B16, and inverse DST7 isrepresented as inverse DST7_B16.

Furthermore, input data may be represented as x[0 . . . 15] and finaloutput data may be represented as y[0 . . . 15].

An encoder performs pre-processing on forward DST7 with a length of 16when the input data x[0 . . . 15] is input thereto (S3210).

The encoder may apply DFT to the output (w[0 . . . 15]) of step S3210(S3220). Here, step S3220 in which DFT is applied will be described indetail later with reference to FIGS. 34 to 36 .

The encoder may perform post-processing on the output (z[0 . . . 15]) ofstep S3220 and output final output data y[0 . . . 15] (S3230).

FIG. 33 is a flowchart illustrating a design of inverse DST7 with alength of 16 using discrete Fourier transform (DFT) as an embodiment towhich the present disclosure is applied.

FIG. 33 shows a flowchart for realizing inverse DST7 for one row orcolumn having a length of 16. Here, input data may be represented as x[0. . . 15] and final output data may be represented as y[0 . . . 15].

A decoder performs pre-processing on inverse DST7 with a length of 16when the input data x[0 . . . 15] is input thereto (S3310).

The decoder may apply DFT to the output of step S3310 (S3320). Here,step S3320 in which DFT is applied will be described in detail laterwith reference to FIGS. 34 to 36 .

The decoder may perform post-processing on the output of step S3320 andoutput final output data y[0 . . . 15] (S3330).

FIGS. 34 to 36 are flowcharts illustrating application of the functionxDST7_FFT_B16 of FIGS. 32 and 33 as embodiments to which the presentdisclosure is applied.

Referring to FIG. 34 , src[0 . . . 15] is input to an xDST7_FFT3 blockand src_FFT11[0 . . . 15] is output therefrom (S3410). The outputsrc_FFT11 [0 . . . 15] may be divided into two partial signals andtransmitted.

For example, src_FFT11 [0 . . . 4] may be transmitted to anxDST7_FFT11_type1 block and src_FFT11 [5 . . . 15] may be transmitted toan xDST7_FFT11 type2 block.

The xDST7_FFT11_type1 block receives src_FFT11[0 . . . 4] and outputsdst[0 . . . 4](S3420).

The xDST7_FFT11_type2 block receives src_FFT11 [5 . . . 15] and outputsdst[5 . . . 15] (S3430).

Here, implementation of the xDST7_FFT11_type1 block is described indetail in FIG. 35 , and implementation of the xDST7_FFT11_type2 block isdescribed in detail in FIG. 36 .

Referring to FIG. 35 , src[0 . . . 4] is input to an xDST7_FFT11_half1block and dst_half1 [0 . . . 4] is output therefrom (S3510).

The output dst_half1 [0 . . . 4] is input to an xDST7_FFT11_type1 blockand dst[0 . . . 4] is output therefrom (S3520).

Referring to FIG. 36 , src[0 . . . 10] may be divided into two partialsignals and transmitted. For example, src[0 . . . 4] may be transmittedto an xDST7_FFT11_half1 block and src[5 . . . 10] may be transmitted toan xDST7_FFT11_half2 block.

The xDST7_FFT11_half1 block receives src [0 . . . 4] and outputsdst_half1 [0 . . . 4] (S3610).

The xDST7_FFT11_half2 block receives src[5 . . . 10] and outputsdst_half2 [0 . . . 5] (S3620).

The encoder/decoder may perform post-processing on the output of stepS3620 through an xDST7_FFT11 type2_Post_Processing block and outputfinal output data dst[0 . . . 10] (S3630).

src_FFT11[5 . . . 15] of FIG. 34 corresponds to src[0 . . . 10] of FIG.36 . That is, allocation is performed in such a manner thatsrc[0]=src_FFT11[5], src[1]=src_FFT11[6], . . . , andsrc[10]=src_FFT11[15].

In addition, dst_half1 [0 . . . 4] and dst_half2 [0 . . . 5] aresequentially input to the xDST7_FFT11_type2_Post_Processing block inFIG. 36 and they respectively correspond to input parameters src_half1[0. . . 4] and src_half2 [0 . . . 5]. This will be described in detailwith reference to the following tables showing operation of each block.

In this manner, the block diagrams of FIGS. 32 and 33 may be interpretedin connection with the block diagrams of FIGS. 34 to 36 .

Detailed operations of the functions of FIGS. 32 to 36 can be describedusing the following tables 23 to 31.

TABLE 23 Name Forward_DST7_Pre_Processing_B16 Input src[0 . . . 15]Output dst[0 . . . 15] Operation dst[0] = src[10]; dst[1] = src[8];dst[2] = src[1]; dst[3] = src[12]; dst[4] = −src[14]; dst[5] = src[6];dst[6] = src[3]; dst[7] = src[5]; dst[8] = −src[15]; dst[9] = src[4];dst[10] = src[2]; dst[11] = src[7]; dst[12] = −src[13]; dst[13] =−src[11]; dst[14] = src[0]; dst[15] = src[9];

TABLE 24 Name Forward_DST7_Post_Processing_B16 Input src[0 . . . 15]Output dst[0 . . . 15] Operation int aiReordIdx[16] = { 12, 0, 14, 10,2, 5, 8, 4, 7, 6, 3, 9, 15, 1, 11, 13 }; for (int i = 0; i < 16; i++)dst[i] = (int)((src[aiReordIdx[i]] + md_factor) >> final_shift);

In Table 24, a value of md_factor=1<<(final_shift−1) can be used. Inaddition, when a function of applying DST7 to all rows or columns of oneblock is used in FIGS. 32 and 33 , a value of final_shift=shift−1 can beused if a value “shift” is transmitted through a parameter.

TABLE 25 Name Inverse_DST7_Pre_Processing_B16 Input src[0 . . . 15]Output dst[0 . . . 15] Operation dst[0] = src[5]; dst[1] = src[4];dst[2] = src[15]; dst[3] = −src[6]; dst[4] = −src[7]; dst[5] = src[3];dst[6] = src[14]; dst[7] = src[13]; dst[8] = −src[8]; dst[9] = src[2];dst[10] = src[1]; dst[11] = src[12]; dst[12] = −src[9]; dst[13] =−src[10]; dst[14] = src[0]; dst[15] = src[11];

TABLE 26 Name Inverse_DST7_Post_Processing_B16 Input src[0 . . . 15]Output dst[0 . . . 15] Operation int aiReordIdx[16] = { 12, 13, 0, 11,14, 1, 10, 15, 2, 9, 5, 3, 8, 6, 4, 7 }; for (int i = 0; i < 16; i++)dst[i] = Clip3(outputMinimum, outputMaximum, (int)((src[aiReordIdx[i]] +md_factor) >> final_shift));

In Table 26, a value of md_factor=1<<(final_shift−1) can be used. Inaddition, when the function of applying DST7 to all rows or columns ofone block is used in FIGS. 32 and 33 , a value of final_shift=shift−1can be used if a value “shift” is transmitted through a parameter.

In Table 26, outputMinimun and outputMaximum indicate available minimumand maximum values of an output value, and the Clip3 function executesoperation of Clip3(A, B, C)=(C<A)?A:(C>B)?B:C. That is, the Clip3function clips a value C such that it must be present in a range of A toB.

TABLE 27 Name xDST7_FFT3 Input src[0 . . . 15] Output dst[0 . . . 15]Operation int C3 = −443; dst[10] = ((−src[0] * C3) + md_factor) >>shift; for (Int i = 0; i < 5; i++) { dst[i] = (((src[3*i + 1] +src[3*i + 2] + src[3*i + 3]) << 9) + md_factor) >> shift;  dst[5 + i] =((((src[3*i + 1] << 1) − src[3*i + 2] − src[3*i + 3]) << 8) +md_factor) >> shift; dst[11 + i] = (((src[3*i + 2] − src[3*i + 3]) *C3) + md_factor) >> shift; }

In Table 25, a value C3 means round

$\left( {\sin{\left( \frac{2\pi}{3} \right) \cdot 2^{9}}} \right)$and represents scaling of a multiplication factor by 2⁹. In Table 27,since shift=10 and md_factor=1<<(shift−1)=2⁹ are applied, dst[i] anddst[5+i] may be calculated by the following equation 4.dst[i]=(src[3*i+1]+src[3*i+2]+src[3*i+3]+1)>>1dst[5+i]=((src[3*i+1]<<1)−src[3*i+2]−src[3*i+3]+2)>>2  [Equation 4]

TABLE 28 Name xDST7_FFT11_half1 Input src[0 . . . 4] Output dst[0 . . .4] Operation int C11R[5] = { 193, 324, 353, 269, 100 }; dst[0] =src[0] * C11R[1] + src[1] * C11R[3] − src[2] * C11R[4] − src[3] *C11R[2] − src[4] * C11R[0]; dst[1] = src[0] * C11R[2] − src[1] * C11R[4]− src[2] * C11R[1] + src[3] * C11R[0] + src[4] * C11R[3]; dst[2] =−src[0] * C11R[3] + src[1] * C11R[2] − src[2] * C11R[0] − src[3] *C11R[4] + src[4] * C11R[1]; dst[3] = src[0] * C11R[4] − src[1] *C11R[0] + src[2] * C11R[3] − src[3] * C11R[1] + src[4] * C11R[2]; dst[4]= src[0] * C11R[0] + src[1] * C11R[1] + src[2] * C11R[2] + src[3] *C11R[3] + src[4] * C11R[4];

In table 28, sequence C11R represents a value calculated through round

$\left( {\frac{1}{\sqrt{{2 \times 16} +}} \cdot {\sin\left( \frac{2\pi i}{11} \right)} \cdot 2^{11}} \right),{i = 1},2,3,4,5.$

TABLE 29 Name xDST7_FFT11_half2 Input src[0 . . . 5] Output dst[0 . . .5] Operation int C11I[6] = { 357, 300, 148, −51, −233, −342 }; dst[0] =(src[0] + src[1] + src[2] + src[3] + src[4] + src[5]) * C11I[0]; dst[1]= src[0] * C11I[0] + src[1] * C11I[2] + src[2] * C11I[4] + src[3] *C11I[5] + src[4] * C11I[3] + src[5] * C11I[1]; dst[2] = src[0] *C11I[0] + src[1] * C11I[3] + src[2] * C11I[5] + src[3] * C11I[2] +src[4] * C11I[1] + src[5] * C11I[4]; dst[3] = src[0] * C11I[0] +src[1] * C11I[4] + src[2] * C11I[3] + src[3] * C11I[1] + src[4] *C11I[5] + src[5] * C11I[2]; dst[4] = src[0] * C11I[0] + src[1] *C11I[5] + src[2] * C11I[1] + src[3] * C11I[4] + src[4] * C11I[2] +src[5] * C11I[3]; dst[5] = src[0] * C11I[0] + src[1] * C11I[1] +src[2] * C11I[2] + src[3] * C11I[3] + src[4] * C11I[4] + src[5] *C11I[5];

In Table 29, sequence C11R represents a value calculated through round

$\left( {\frac{1}{\sqrt{{2 \times 16} + 1}} \cdot {\cos\left( \frac{2\pi i}{11} \right)} \cdot 2^{11}} \right),{i = 0},1,2,3,4,5.$

TABLE 30 Name xDST7_FFT11_type1_Post_Processing Input src[0 ... 4]Output dst[0 ... 4] Operation dst[0] = src[4]: dst[1] = −src[0]; dst[2]= src[1]; dst[3] = src[2]; dst[4] = src[3];

TABLE 31 Name xDST7_FFT11_type2_Post_Processing Input src_half1[0 ...4], src_half2[0 ... 5] Output dst[0 ... 10] Operation dst[0] =−src_half2[0]; dst[1] = src_half2[5] − src_half1[4]; dst[2] =−(src_half2[1] − src_half1[0]); dst[3] = src_half2[2] − src_half1[1];dst[4] = −(src_half2[3] + src_half1[2]); dst[5] = src_half2[4] −src_half1[3]; dst[6] = −(src_half2[4] + src_half1[3]); dst[7] =src_half2[3] − src_half1[2]; dst[8] = src_half2[2] + src_half1[1];dst[9] = −(src_half2[1] + src_half1[0]); dst[10] = src_half2[5] +src_half1[4];

When DST7 is applied to a 16×16 two-dimensional block in the horizontaldirection (or vertical direction), the flowcharts of FIGS. 32 and 33 canbe used for 16 rows (or columns).

FIG. 37 is a flowchart illustrating a design of forward DST7 with alength of 32 using discrete Fourier transform (DFT) as an embodiment towhich the present disclosure is applied.

The present disclosure provides specific embodiments of designing DST7using DFT. The embodiments of the present disclosure can be used forDCT8 design and applied to MTS configuration.

FIG. 37 shows a flowchart for realizing DST7 for one row or columnhaving a length of 32. Here, DST7 with a length of 32 is represented asDST7_B32, forward DST7 is represented as Forward DST7_B32, and inverseDST7 is represented as Inverse DST7_B32.

Further, input data may be represented as x[0 . . . 31] and final outputdata may be represented as y[0 . . . 31].

An encoder performs pre-processing on forward DST7 with a length of 32when the input data x[0 . . . 31] is input thereto (S3710).

The encoder may apply DFT to the output (w[0 . . . 31]) of step S3710(S3720). Here, step S3720 in which DFT is applied will be described indetail later with reference to FIGS. 39 to 41 .

The encoder may perform post-processing on the output (z[0 . . . 31]) ofstep S3720 and output final output data y[0 . . . 31] (S3730).

FIG. 38 is a flowchart illustrating a design of inverse DST7 with alength of 32 using discrete Fourier transform (DFT) as an embodiment towhich the present disclosure is applied.

FIG. 38 shows a flowchart for realizing inverse DST7 for one row orcolumn having a length of 32. Here, input data may be represented as x[0. . . 31] and final output data may be represented as y[0 . . . 31].

A decoder performs pre-processing on inverse DST7 with a length of 32when the input data x[0 . . . 31] is input thereto (S3810).

The decoder may apply DFT to the output w[0 . . . 31] of step S3810(S3320). Here, step S3820 in which DFT is applied will be described indetail later with reference to FIGS. 39 to 41 .

The decoder may perform post-processing on the output z[0 . . . 31] ofstep S3820 and output final output data y[0 . . . 31] (S3830).

FIGS. 39 to 41 are flowcharts illustrating application of the functionxDST7_FFT_B32 of FIGS. 37 and 38 as embodiments to which the presentdisclosure is applied.

Referring to FIG. 39 , src[0 . . . 31] is input to an xDST7_FFT5 blockand src_FFT13 [0 . . . 31] is output therefrom (S3910). The outputsrc_FFT13 [0 . . . 31] may be divided into three partial signals andtransmitted.

For example, src_FFT13 [0 . . . 5] may be transmitted to an xDST7_FFT13type1 block, src_FFT13 [6 . . . 18] may be transmitted to anxDST7_FFT13_type2 block, and src_FFT13[19 . . . 31] may be transmittedto another xDST7_FFT13_type2 block.

The xDST7_FFT13_type1 block receives src_FFT13 [0 . . . 5] and outputsdst[0 . . . 5] (S3920).

The xDST7_FFT13_type2 block receives src_FFT13[6 . . . 18] and outputsdst[6 . . . 18] (S3930).

The xDST7_FFT13_type2 block receives src_FFT13[9 . . . 31] and outputsdst[19 . . . 31] (S3940).

Here, implementation of the xDST7_FFT13_type1 block is described indetail in FIG. 40 , and implementation of the xDST7_FFT13_type2 block isdescribed in detail in FIG. 41 .

Referring to FIG. 40 , src[0 . . . 5] is input to an xDST7_FFT13_half1block and dst_half1 [0 . . . 5] is output therefrom (S4010).

The output dst_half1 [0 . . . 5] is input to anxDST7_FFT13_type1_Post_Processing block and dst[0 . . . 5] is outputtherefrom (S4020).

Referring to FIG. 41 , src[0 . . . 12] may be divided into two partialsignals and transmitted. For example, src[0 . . . 5] may be transmittedto an xDST7_FFT13_half1 block and src[6 . . . 12] may be transmitted toan xDST7_FFT13_half2 block.

The xDST7_FFT13_half1 block receives src [0 . . . 5] and outputsdst_half1 [0 . . . 5](S4110).

The xDST7_FFT13_half2 block receives src[6 . . . 12] and outputsdst_half2 [0 . . . 6](S4120).

The encoder/decoder may perform post-processing on the outputs of stepsS4110 and S4120 through an xDST7_FFT13 type2_Post_Processing block andoutput final output data dst[0 . . . 12] (S4130).

src_FFT13 [0 . . . 5] of FIG. 39 corresponds to src[0 . . . 5] of FIG.40 . That is, allocation is performed in such a manner thatsrc[0]=src_FFT13[0], src[1]=src_FFT13 [1], . . . , andsrc[5]=src_FFT13[5].

In addition, src_FFT13[16 . . . 18] or src_FFT13[19 . . . 31] of FIG. 39corresponds to src[0 . . . 12] of FIG. 40 . For example, allocation isperformed in such a manner that src[0]=src_FFT13[6],src[1]=src_FFT13[7], . . . , and src[12]=src_FFT13[18].

Furthermore, dst_half1[0 . . . 5] and dst_half2 [0 . . . 6] aresequentially input to the xDST7_FFT13 type2_Post_Processing block inFIG. 41 and they respectively correspond to input parameters src_half1[0. . . 5] and src_half2[0 . . . 6]. This will be described in detail withreference to the following tables showing operation of each block.

In this manner, the block diagrams of FIGS. 37 and 38 may be interpretedin connection with the block diagrams of FIGS. 39 to 41 .

Detailed operations of the functions of FIGS. 37 to 41 can be describedusing the following tables 32 to 39.

TABLE 32 Name Forward_DST7_Pre_Processing_B32 Input src[0 ... 31] Outputdst[0 ... 31] Operation int aiFFTInReordIdx[32] = { 12, 25, −14, 1, 10,−23, 27, 29, −16, 3, 8, −21, −19, 31, −18, 5, 6, 4, −17, 30, −20, 7, 9,2, −15, 28, −22, −24, 11, 0, −13, 26 }; for (int i = 0; i < 32; i++) {int index = aiFFTInReordIdx[i]; dst[i] = (index < 0) ? −src[−index] :src[index]; }

TABLE 33 Name Forward_DST7_Post_Processing_B32 Input src[0 ... 31]Output dst[0 ... 31] Operation int aiFFTOutReordIdx[32] = { −27, −17, 0,15, 25, −29, −6, 2, 13, 23, −31, −8, 4, 11, 21, −20, −10, 5, 9, 19, −22,−12, 3, 7, 30, −24, −14, 1, 18, 28, −26, −16 }; for (int i = 0; i < 32;i++) { int index = aiFFTOutReordIdx[i];  dst[i] = (int)((((index < 0) ?−src[−index] : src[index]) + rnd_factor) >> final_shift); }

In Table 33, a value of md_factor=1<<(final_shift−1) can be used. Inaddition, when a function of applying DST7 to all rows or columns of oneblock is used in FIGS. 37 and 38 , a value of final_shift=shift−1 can beused if a value “shift” is transmitted through a

TABLE 34 Name Inverse_DST7_Pre_Processing_B32 Input src[0 ... 31] Outputdst[0 ... 31] Operation int aiFFTInReordIdx[32] = { 6, 19, −7, 31, 5,−20, 18, 17, −8, 30, 4, −21, −22, 16, −9, 29, 3, 2, −23, 15, −10, 28,27, 1, −24, 14, −11, −12, 26, 0, −25, 13 }; for (int i = 0; i < 32; i++){ int index = aiFFTInReordIdx[i]; dst[i] = (index < 0) ? −src[−index] :src[index]; }

TABLE 35 Name Inverse_DST7_Post_Processing_B32 Input src[0 ... 31]Output dst[0 ... 31] Operation int aiFFTOutReordIdx[32] = { −27, −16,−17, −26, 0, 28, 15, 18, 25, 1, −29, −14, −6, −24, 2, 30, 13, 7, 23, 3,−31, −12, −8, −22, 4, 19, 11, 9, 21, 5, −20, −10 }; for (int i = 0; i <32; i++) { int index = aiFFTOutReordIdx[i];  dst[i] =Clip3(outputMinimum, outputMaximum, (Int)((((index < 0) ? −src[− index]: src[index]) + rnd_factor) >> final_shift)); }

In Table 35, a value of md_factor=1<<(final_shift−1) can be used. Inaddition, when a function of applying DST7 to all rows or columns of oneblock is used in FIGS. 37 and 38 , a value of final_shift=shift−1 can beused if a value “shift” is transmitted through a parameter.

In Table 35, outputMinimun and outputMaximun indicate available minimumand maximum values of an output value, and the Clip3 function executesoperation of Clip3(A, B, C)=(C<A)?A:(C>B)?B:C. That is, the Clip3function clips a value C such that it must be present in a range of A toB.

TABLE 36 Name xDST7_FFT13_half1 Input src[0 ... 5] Output dst[0 ... 5]Operation Int C13R[6] = { 167, 296, 357, 336, 238, 86 }; dst[0] =−src[0] * C13R[0] − src[1] * C13R[1] − src[2] * C13R[2] − src[3] *C13R[3] − src[4] * C13R[4] − src[5] * C13R[5]; dst[1] = −src[0] *C13R[1] − src[1] * C13R[3] − src[2] * C13R[5] + src[3] * C13R[4] +src[4] * C13R[2] + src[5] * C13R[0]; dst[2] = −src[0] * C13R[2] −src[1] * C13R[5] + src[2] * C13R[3] + src[3] * C13R[0] − src[4] *C13R[1] − src[5] * C13R[4]; dst[3] = −src[0] * C13R[3] + src[1] *C13R[4] + src[2] * C13R[0] − src[3] * C13R[2] + src[4] * C13R[5] +src[5] * C13R[1]; dst[4] = −src[0] * C13R[4] + src[1] * C13R[2] −src[2] * C13R[1] + src[3] * C13R[5] + src[4] * C13R[0] − src[5] *C13R[3]; dst[5] = −src[0] * C13R[5] + src[1] * C13R[0] − src[2] *C13R[4] + src[3] * C13R[1] − src[4] * C13R[3] + src[5] * C13R[2];

In Table 36, sequence C13R represents a value calculated through round

$\left( {\frac{1}{\sqrt{{2 \times 32} + 1}} \cdot \sqrt{2} \cdot {\sin\left( \frac{2\pi i}{13} \right)} \cdot 2^{11}} \right),{i = 1},2,3,4,5,6.$

TABLE 37 Name xDST7_FFT13_half2 Input src[0 ... 6] Output dst[0 ... 6]Operation int C13I[7] = { 359, 318, 204, 43, −127, −269, −349 }; dst[0]= (src[0] + src[1] + src[2] + src[3] + src[4] + src[5] + src[6]) *C13I[0]; dst[1] = src[0] * C13I[0] + src[1] * C13I[1] + src[2] *C13I[2] + src[3] * C13I[3] + src[4] * C13I[4] + src[5] * C13I[5] +src[6] * C13I[6]; dst[2] = src[0] * C13I[0] + src[1] * C13I[2] +src[2] * C13I[4] + src[3] * C13I[6] + src[4] * C13I[5] + src[5] *C13I[3] + src[6] * C13I[1]; dst[3] = src[0] * C13I[0] + src[1] *C13I[3] + src[2] * C13I[6] + src[3] * C13I[4] + src[4] * C13I[1] +src[5] * C13I[2] + src[6] * C13I[5]; dst[4] = src[0] * C13I[0] +src[1] * C13I[4] + src[2] * C13I[5] + src[3] * C13I[1] + src[4] *C13I[3] + src[5] * C13I[6] + src[6] * C13I[2]; dst[5] = src[0] *C13I[0] + src[1] * C13I[5] + src[2] * C13I[3] + src[3] * C13I[2] +src[4] * C13I[6] + src[5] * C13I[1] + src[6] * C13I[4]; dst[6] =src[0] * C13I[0] + src[1] * C13I[6] + src[2] * C13I[1] + src[3] *C13I[5] + src[4] * C13I[2] + src[5] * C13I[4] + src[6] * C13I[3];

In Table 37, sequence C13I represents a value calculated through round

$\left( {\frac{1}{\sqrt{{2 \times 32} +}} \cdot \sqrt{2} \cdot {\cos\left( \frac{2\pi i}{13} \right)} \cdot 2^{11}} \right),{i = 0},1,2,3,4,5,6.$

TABLE 38 Name xDST7_FFT13_type1_Post_Processing Input src[0 ... 5]Output dst[0 ... 5] Operation dst[0] = −src[0]; dst[1] = src[1]; dst[2]= −src[2]; dst[3] = src[3]; dst[4] = −src[4]; dst[5] = src[5]

TABLE 39 Name xDST7_FFT13_type2_Post_Processing Input src_half1[0 ...5], src_half2[0 ... 6] Output dst[0 ... 12] Operation dst[0] =src_half2[0]; for (int i = 0; i < 6; i++) { dst[1 + i] = src_half1[i] +src_half2[1 + i]; } for (int i = 0; i < 6; i++) {  dst[7 + i] =−src_half1[5 − i] + src_half2[6 − i]; }

When DST7 is applied to a 32×32 two-dimensional block in the horizontaldirection (or vertical direction), the flowcharts of FIGS. 37 and 38 canbe used for 32 rows (or columns).

FIG. 42 is a flowchart illustrating a design of forward DST7 with alength of 8 using discrete Fourier transform (DFT) as an embodiment towhich the present disclosure is applied.

The present disclosure provides specific embodiments of designing DST7using DFT. The embodiments of the present disclosure can be used forDCT8 design and applied to MTS configuration.

FIG. 42 shows a flowchart for realizing DST7 for one row or columnhaving a length of 8. Here, DST7 with a length of 8 is represented asDST7_B8, forward DST7 is represented as Forward DST7_B8, and inverseDST7 is represented as Inverse DST7_B8.

Further, input data may be represented as x[0 . . . 7] and final outputdata may be represented as y[0 . . . 7].

An encoder performs pre-processing on forward DST7 with a length of 8when the input data x[0 . . . 7] is input thereto (S4210).

The encoder may apply DFT to the output (w[0 . . . 7]) of step S4210(S4220). Here, step S4220 in which DFT is applied will be described indetail later with reference to FIGS. 44 and 45 .

The encoder may perform post-processing on the output (z[0 . . . 7]) ofstep S4220 and output final output data y[0 . . . 7](S4230).

FIG. 43 is a flowchart illustrating a design of inverse DST7 with alength of 8 using discrete Fourier transform (DFT) as an embodiment towhich the present disclosure is applied.

FIG. 43 shows a flowchart for realizing inverse DST7 for one row orcolumn having a length of 8. Here, input data may be represented as x[0. . . 7] and final output data may be represented as y[0 . . . 7].

A decoder performs pre-processing on inverse DST7 with a length of 8when the input data x[0 . . . 7] is input thereto (S4310).

The decoder may apply DFT to the output w[0 . . . 7] of step S4310(S4320). Here, step S4320 in which DFT is applied will be described indetail later with reference to FIGS. 44 and 45 .

The decoder may perform post-processing on the output z[0 . . . 7] ofstep S2620 and output final output data y[0 . . . 7](S4330).

Detailed operations of the functions of FIGS. 42 and 43 can be describedusing the following tables 40 to 44.

TABLE 40 Name Forward_DST7_Pre_Processing_B8 Input src[0 ... 7] Outputdst[0 ... 7] Operation dst[0] = src[1]; dst[1] = src[5]; dst[2] =−src[0]; dst[3] = −src[2]; dst[4] = −src[7]; dst[5] = src[6]; dst[6] =−src[3]; dst[7] = −src[4];

TABLE 41 Name Forward_DST7_Post_Processing_B8 Input src[0 ... 7] Outputdst[0 ... 7] Operation int aiReordIdx[8] = { 0, 2, 4, 6, 7, 5, 3, 1 };for (int i = 0; i < 8; i++) { dst[i] = (int)((src[aiReordIdx[i]] +rnd_factor) >> shift); }

In Table 41, a value of md_factor=1<<(final_shift−1) can be used. Inaddition, when a function of applying DST7 to all rows or columns of oneblock is used, a value of final_shift=shift−1 can be used if a value“shift” is transmitted through a parameter.

TABLE 42 Name Inverse_DST7_Pre_Processing_B8 Input src[0 ... 7] Outputdst[0 ... 7] Operation dst[0] = src[7]; dst[1] = src[5]; dst[2] =−src[0]; dst[3] = −src[1]; dst[4] = −src[4]; dst[5] = src[3]; dst[6] =−src[6]; dst[7] = −src[2];

TABLE 43 Name Inverse_DST7_Post_Processing_B8 Input src[0 ... 7] Outputdst[0 ... 7] Operation for (Int i = 0; i < 8; i++) { dst[i] =Clip3(outputMinimum, outputMaximum, (Int)((src[i]) + rnd_factor) >>shift); }

In Table 43, a value of md_factor=1<<(final_shift−1) can be used. Inaddition, when a function of applying DST7 to all rows or columns of oneblock is used, a value of final_shift=shift−1 can be used if a value“shift” is transmitted through a parameter.

In Table 43, outputMinimum and outputMaximum indicate available minimumand maximum values of an output value, and the Clip3 function executesoperation of Clip3(A, B, C)=(C<A)?A:(C>B))?B:C. That is, the Clip3function clips a value C such that it must be present in a range of A toB.

TABLE 44 Name xDST7_FFT_B8 Input src[0 ... 7] Output dst[0 ... 7]Operation int C8[8] = { 127, 237, 314, 350, 338, 280, 185, 65 }; dst[0]= src[0] * C8[0] + src[1] * C8[2] − src[2] * C8[7] − src[3] * C8[6] −src[4] * C8[3] + src[5] * C8[4] − src[6] * C8[1] − src[7] * C8[5];dst[1] = −src[0] * C8[1] − src[1] * C8[5] − src[2] * C8[0] − src[3] *C8[2] + src[4] * C8[7] + src[5] * C8[6] + src[6] * C8[3] − src[7] *C8[4]; dst[2] = src[0] * C8[2] − src[1] * C8[7] − src[2] * C8[6] −src[3] * C8[3] + src[4] * C8[4] − src[5] * C8[1] − src[6] * C8[5] −src[7] * C8[0]; dst[3] = −src[0] * C8[3] + src[1] * C8[4] − src[2] *C8[1] − src[3] * C8[5] − src[4] * C8[0] − src[5] * C8[2] + src[6] *C8[7] + src[7] * C8[6]; dst[4] = src[0] * C8[4] − src[1] * C8[1] −src[2] * C8[5] − src[3] * C8[0] − src[4] * C8[2] + src[5] * C8[7] +src[6] * C8[6] + src[7] * C8[3]; dst[5] = −src[0] * C8[5] − src[1] *C8[0] − src[2] * C8[2] + src[3] * C8[7] + src[4] * C8[6] + src[5] *C8[3] − src[6] * C8[4] + src[7] * C8[1]; dst[6] = src[0] * C8[6] +src[1] * C8[3] − src[2] * C8[4] + src[3] * C8[1] + src[4] * C8[5] +src[5] * C8[0] + src[6] * C8[2] − src[7] * C8[7]; dst[7] = −src[0] *C8[7] − src[1] * C8[6] − src[2] * C8[3] + sr[3] * C8[4] − src[4] * C8[1]− src[5] * C8[5] − src[6] * C8[0] − src[7] * C8[2];

In Table 44, sequence C8 represents a value calculated through round

$\left( {\frac{1}{\sqrt{{2 \times 8} + 1}} \cdot \sqrt{2} \cdot {\sin\left( \frac{2\pi i}{17} \right)} \cdot 2^{10}} \right),{i = 1},2,3,4,5,6,7,8.$

When DST7 is applied to an 8×8 two-dimensional block in the horizontaldirection (or vertical direction), the flowcharts of FIGS. 42 and 43 canbe used for 8 rows (or columns).

In embodiments of the present disclosure, DST7 implementation proposedin embodiment 1 and embodiment 2 may be applied to length-16 DST7 andlength-32 DST7, and DST7 implementation proposed in embodiment 3 may beapplied to length-8 DST7. However, the present disclosure is not limitedthereto and may be applied in different manners. For example, when DST7implementation proposed in embodiment 3 is not applied, DST7implementation in a general matrix multiplication form may be applied.

In an embodiment of the present disclosure, a matrix form of N×N DST7may be represented by Equation 5.

$\begin{matrix}{{{\left\lbrack S_{N}^{VII} \right\rbrack_{n,k} = {\frac{2}{\sqrt{{2N} + 1}}{\sin\left( \frac{{\pi\left( {{2k} + 1} \right)}\left( {n + 1} \right)}{{2N} + 1} \right)}}},n,{k = 0},1,\ldots,{N - 1}}} & \left\lbrack {{Equation}5} \right\rbrack\end{matrix}$

Here, when n is a row index in a range of 0 to N−1 and k is a columnindex in a range of 0 to N−1, the matrix of Equation 5 matches aninverse DST7 matrix multiplied by transform coefficients to restoreoriginal inputs.

Accordingly, the transpose matrix of Equation 5 is a forward DST7matrix. Further, forward DST7 and inverse DST7 matrices are orthogonal,and basic vectors thereof have norm 1.

A relationship between DST7 and DFT may be represented by Equations 6and 7 based on Equation 5.

$\begin{matrix}{\left( S_{N}^{VII} \right)^{T} = {{R{\mathcal{J}\left\lbrack F_{{2N} + 1} \right\rbrack}{QP}{{where}\lbrack R\rbrack}_{n,k}} = \left\{ {\begin{matrix}{{- 1},} & {{{{if}k} = {{2n} + 1}},} & {{n = 0},1,\ldots,{N - 1}} \\{0,} & {otherwise} & \end{matrix},} \right.}} & \left\lbrack {{Equation}6} \right\rbrack\end{matrix}$

$\begin{matrix}{{Q = \begin{pmatrix}O^{T} \\I_{N} \\{- J_{N}}\end{pmatrix}},{{{and}\lbrack P\rbrack}_{n,k} = \left\{ \begin{matrix}{1,} & {{{{{if}k} + 1} = {2\left( {n + 1} \right)}},} & {{n = 0},1,\ldots,{{N/2} - 1}} \\{1,} & {{{{{if}k} + 1} = {{2\left( {N - n} \right)} - 1}},} & {{n = {N/2}},\ldots,{N - 1}} \\{0,} & {otherwise} & \end{matrix} \right.}} & \left\lbrack {{Equation}7} \right\rbrack\end{matrix}$

In Equation 6, R is an N×(2N+1) matrix (number of rows×number ofcolumns), Q is a (2N+1)×N matrix, and P is an N×N matrix. I_(N)represents an N×N identity matrix and J_(N) represents

$\left\lbrack J_{N} \right\rbrack_{{ij},i,{j = 0},\ldots,{N - 1}} = \left\{ {\begin{matrix}{1,} & {j = {N - 1 - i}} \\{0,} & {otherwise}\end{matrix}.} \right.$

In Equation 6, ℑ[F_(2N+1)] means that only an imaginary part of a DFTresult is taken after (2N+1)−length DFT is performed. Equation 6 is heldonly when N is an even number. Specifically, ℑ[F_(2N+1)] means that(2N+1)×1 vector z is output when z=QPx is calculated in a case where xinput to forward DST7 is an N×1 vector, and only an imaginary part istaken after (2N+1)−length DFT is performed using the vector z as input.

As in Equations 6 and 7, the matrices P, Q, and R are used to performrearrangement of only N inputs and assignment of sign (+/−) thereof suchthat a principal calculation part becomes (2N+1)−length DFT in forwardDST7.

The present disclosure uses DST7 having a size of 2n×2n (N=2n).Accordingly, 9-point DFT, 17-point DFT, 33-point DFT, and 65-point DFTmay be applied when N=4, 8, 16, 32, respectively.

The present disclosure is described based on a case in which N=8, 16,32, introduces a design of corresponding DFTs as a form ofmulti-dimensional DFT, and provides a method of integrating the DFTs inorder to obtain low-complexity DST7.

Inverse N×N DST7 consistent with forward DST6 may be represented as(2N+1)−length DFT as represented in Equations 8 and 9.

$\begin{matrix}{{S_{N}^{VII} = {R{\mathcal{J}\left\lbrack F_{{2N} + 1} \right\rbrack}{QP}}},{{{where}\lbrack R\rbrack}_{n,k} = \left\{ {\begin{matrix}{1,} & {{{{if}k} = {n + 1}},} & {{n = 1},3,\ldots,{N - 1}} \\{{- 1},} & {{{{if}k} = {n + 1}},} & {{n = 0},2,\ldots,{N - 2}} \\{0,} & {otherwise} & \end{matrix},} \right.}} & \left\lbrack {{Equation}8} \right\rbrack\end{matrix}$

$\begin{matrix}{{Q = \begin{pmatrix}O^{T} \\J_{N} \\{- I_{N}}\end{pmatrix}},{{{and}\lbrack P\rbrack}_{n,k} = \left\{ \begin{matrix}{1,} & {{{{if}k} = n},} & {{n = 0},1,\ldots,{N - 1}} \\{0,} & {otherwise} & \end{matrix} \right.}} & \left\lbrack {{Equation}9} \right\rbrack\end{matrix}$

Here, R is an N×(2N+1) matrix (number of rows number of columns), Q is a(2N+1)×N matrix, and I_(N) represents an N×N identify matrix. J_(N) isdefined as in Equations 6 and 7.

ℑ[F_(2N+1)] means that (2N+1)×1 vector Z is output when z=Qx iscalculated in a case where x input to forward DST7 is an N×1 vector, andonly an imaginary part is taken after (2N+1)−length DFT is performedusing the vector z as input. That is, ℑ[F_(2N+1)] in Equation 9 isdefined as in Equations 6 and 7 except calculation of z=QPx.

In Equations 9 and 10. N is an even number. Further, (2N+1)−length DFTwhich is the same as that in forward DST7 can also be reused for inverseDST7.

A trigonometric transform having a length of an even number may beapplied to a CODEC system to which the present disclosure is applied.For example, length-17, 33, 65, and 129 DFTs from Equations 6 and 7 arerespectively required for length-8, 16, 32, and 64 DST7. 33-point DFTand 65-point DFT applicable to length-8 DST7 and length-16 DST7 may berepresented as a one-dimensional DFT as in Equations 10 and 11. Equation12 represents a general length-N DFT formula.

$\begin{matrix}\begin{matrix}{{{X(k)} = {\frac{1}{\sqrt{{2 \cdot 16} + 1}}{\sum\limits_{n = 0}^{32}{x(n)W_{N}^{nk}}}}},} & {W_{N} = e^{- {j({2{\pi/33}})}}}\end{matrix} & \left\lbrack {{Equation}10} \right\rbrack\end{matrix}$ $\begin{matrix}\begin{matrix}{{{X(k)} = {\frac{1}{\sqrt{{2 \cdot 32} + 1}}{\sum\limits_{n = 0}^{64}{x(n)W_{N}^{nk}}}}},} & {W_{N} = e^{- {j({2{\pi/65}})}}}\end{matrix} & \left\lbrack {{Equation}11} \right\rbrack\end{matrix}$ $\begin{matrix}\begin{matrix}{{{X(k)} = {\frac{1}{\sqrt{N}}{\sum\limits_{n = 0}^{N - 1}{x(n)W_{N}^{nk}}}}},} & {W_{N} = e^{- {j({2{\pi/M}})}}}\end{matrix} & \left\lbrack {{Equation}12} \right\rbrack\end{matrix}$

Although the procedure of applying (2N+1)−length DFT in order toimplement N×N DST7 has been described, length N can be used instead oflength 2N+1 in description including Equations 10 and 11 for convenienceof notation. Accordingly, when DFT is applied through Equations 6 to 9,appropriate notational conversion is required.

Furthermore, the aforementioned one-dimensional 33-point DFT andone-dimensional 65-point DFT are also represented as equivalenttwo-dimensional DFTs through simple input/output data conversion, andequations corresponding thereto are Equations 13 and 14.

$\begin{matrix}{{{\hat{X}\left( {k_{1},k_{2}} \right)} = {{\frac{1}{\sqrt{{2 \cdot 16} + 1}}{\sum\limits_{n_{2} = 0}^{10}{\sum\limits_{n_{1} = 0}^{2}{{\overset{\hat{}}{x}\left( {n_{1},n_{2}} \right)}W_{3}^{n_{1}k_{1}}W_{11}^{n_{2}k_{2}}}}}} = {\sum\limits_{n_{2} = 0}^{10}{{\hat{y}\left( {k_{1},n_{2}} \right)}W_{11}^{n_{2}k_{2}}}}}}} & \left\lbrack {{Equation}13} \right\rbrack\end{matrix}$ $\begin{matrix}{{{\hat{X}\left( {k_{1},k_{2}} \right)} = {{\frac{1}{\sqrt{{2 \cdot 32} + 1}}{\sum\limits_{n_{2} = 0}^{12}{\sum\limits_{n_{1} = 0}^{4}{{\overset{\hat{}}{x}\left( {n_{1},n_{2}} \right)}W_{5}^{n_{1}k_{1}}W_{13}^{n_{2}k_{2}}}}}} = {\sum\limits_{n_{2} = 0}^{12}{{\hat{y}\left( {k_{1},n_{2}} \right)}W_{13}^{n_{2}k_{2}}}}}}} & \left\lbrack {{Equation}14} \right\rbrack\end{matrix}$

Here, n denotes an index for input data and k denotes an index for atransform coefficient.

Hereinafter, a residue of a number is represented as

x

_(N)=x mod N. Further, four index variables n₁, n₂, k₁, and k₂ areintroduced, and a relationship between 33-point DFT and 65-point DFT isrepresented by Equations 15 and 16.n=

22n ₁+12n ₂

₃₃k=

11k ₁+3k ₂

₃₃  [Equation 15]n=

26n ₁+40n ₂

₆₅k=

13k ₁+5k ₂

₆₅  [Equation 16]

Here, n denotes an index for input data and k denotes an index for atransform coefficient. Equation 15 represents indexes mapped to 33-pointDFT and Equation 16 represents indexes mapped to 65-point DFT.

According to Equations 15 and 16, input/output data mapping betweenone-dimensional DFT and two-dimensional DFT is given as represented byEquations 17 and 18. From Equations 15 and 16, the present disclosurecan define new input/output variables with two index arguments{circumflex over (x)}(n₁,n₂) and {circumflex over (X)}(k₁,k₂) asrepresented by Equations 17 and 19.{circumflex over (x)}(n ₁ ,n ₂)=x

22n ₁+12n ₂

₃₃){circumflex over (X)}(k ₁ ,k ₂)=X(

11k ₁+3k ₂

₃₃)  [Equation 17]{circumflex over (x)}(n ₁ ,n ₂)=x(

26n ₁+40n ₂

₆₅){circumflex over (X)}(k ₁ ,k ₂)=X(

13k ₁+5k ₂

₆₅)  [Equation 18]

Here

x

_(N)=x mod N.

Although two-dimensional DFT is realized by Equations 15 and 17 in anembodiment of the present disclosure, the present disclosure is notlimited thereto. That is, when Equation 19 is satisfied, two-dimensionalDFT as represented by Equations 13 and 14 can be realized.N=N ₁ N ₂n=

K ₁ n ₁ +K ₂ n ₂

_(N)k=

K ₃ k ₁ +K ₄ k ₂

_(N)

K ₁ K ₃

_(N) =N ₂

K ₂ K ₄

_(N) =N ₁

K ₁ K ₄

_(N) =

K ₂ K ₃

_(N)=0  [Equation 19]

Here, N₁ and N₂ are mutually prime factors, and

x

_(N)=x mod N.

33-point one-dimensional DFT corresponds to (N1, N2)=(3, 11) and65-point one-dimensional DFT corresponds to (N1, N2)=(5, 13). In bothcases, N1 and N₂ are mutually prime factors, and thus, Equation 19 isapplicable. If K₁, K₂, K₃, and K₄ satisfy Equation 20, the condition of

K₁K₄

_(N)=

K₂K₃

_(N)=0 in Equation 19 is satisfied.K ₁ =αN ₂ ,K ₂ =βN ₁ ,K ₃ =γN ₂ ,K ₄ =δN ₁  [Equation 20]

In addition, to satisfy other conditions of Equation 19, relations inEquation 21 need to be satisfied.

αγN ₂

_(N) ₁ =1,

βδN ₁

_(N) ₂ =1  [Equation 21]

Accordingly, K₁, K₂, K₃, and K₄ that satisfy Equation 19 can be derivedfrom Equation 20 using α, β, γ, δ that satisfy Equation 21, and thus,equivalent two-dimensional DFT can be configured. Embodiments ofavailable α, β, γ, δ are as follows.

1) (α, β, γ, δ)=(2, 4, 1, 1)

This corresponds to Equation 15 and a case of (N1, N2)=(3, 11).

2) (α, β, γ, δ)=(2, 8, 1, 1)

This corresponds to Equation 15 and a case of (N1, N2)=(5, 13).

3) (α, β, γ, δ)=(1, 1, 2, 4)

This corresponds to a case of (N1, N2)=(3, 11).

4) (α, β, γ, δ)=(1, 1, 2, 8)

This corresponds to a case of (N1, N2)=(5, 13).

When the corresponding two-dimensional DFT is configured according toK₁, K₂, K₃, and K₄ derived from α, β, γ, δ that satisfy Equation 21,symmetry with respect to input/output data and intermediate resultvalues as in the aforementioned equations may be generated in a processof calculating the two-dimensional DFT.

Accordingly, even in the case of two-dimensional DFT having indexesdifferent from those of the above-described embodiments (i.e., havingdifferent α, β, γ, δ values), complexity required to execute DST7 can beconsiderably reduced by applying methods and structures proposed in theabove-described embodiments.

In short, DFT for a length of N (N=N₁N₂, N₁ and N₂ are mutually primefactors) can be calculated as two-dimensional DFT as represented byEquation 22 through index conversion (i.e., conversion between aone-dimensional index and a two-dimensional index) that satisfyEquations 19 to 21.

$\begin{matrix}{{{\hat{X}\left( {k_{1},k_{2}} \right)} = {{\frac{1}{\sqrt{N}}{\sum\limits_{n_{2} = 0}^{N_{2} - 1}{\sum\limits_{n_{1} = 0}^{N_{1} - 1}{{\hat{x}\left( {n_{1},n_{2}} \right)}W_{N_{1}}^{n_{1}k_{1}}W_{N_{2}}^{n_{2}k_{2}}}}}} = {\sum\limits_{n_{2} = 0}^{N_{2} - 1}{{\hat{y}\left( {k_{1},n_{2}} \right)}W_{N_{2}}^{n_{2}k_{2}}}}}}} & \left\lbrack {{Equation}22} \right\rbrack\end{matrix}$

When the two-dimensional DFT form of Equation 22 is used, this can bedecomposed into short-length DFTs and calculated and thus the amount ofcalculation can be considerably reduced as compared to equivalentone-dimensional DFT.

In an embodiment of the present disclosure, according to Equations 13and 14, 3-point DFT of {circumflex over (x)}(0,n₂), {circumflex over(x)}(1,n₂), and {circumflex over (x)}(2,n₂) and 5-point DFT of{circumflex over (x)}(0,n₂), {circumflex over (x)}(1,n₂), {circumflexover (x)}(2,n₂), {circumflex over (x)}(3,n₂), and {circumflex over(x)}(4, n₂) are performed forgiven n₂.

For ŷ(k₁,n₂) generated after execution of an inner DFT loop of Equations13 and 14, the present disclosure can define a real part and animaginary part of ŷ(k₁,n₂) as represented in Equation 23.ŷ(k ₁ ,n ₂)=ŷ _(R)(k ₁ ,n ₂)+j·ŷ _(I)(k ₁ ,n ₂)  [Equation 23]

Here, ŷ_(R) represents the real part and ŷ_(I) represents the imaginarypart.

Similarly, input {circumflex over (x)}(n₁,n₂) and output {circumflexover (X)}(k₁,k₂) can also be decomposed into a real part and animaginary part.{circumflex over (x)}(n ₁ ,n ₂)={circumflex over (x)} _(R)(n ₁ ,n₂)+j·{circumflex over (x)} _(I)(n ₁ ,n ₂){circumflex over (X)}(k ₁ ,k ₂)={circumflex over (X)} _(R)(k ₁ ,k₂)+j·{circumflex over (X)} _(I)(k ₁ ,k ₂)  [Equation 24]Here, input {circumflex over (x)}(n₁,n₂) may be pixels or residual datato which a designated transform is predicted to be applied. Accordingly,it can be assumed that all actual {circumflex over (x)}(n₁,n₂) have avalue of 0.

On this assumption, the present disclosure can check relationshipsbetween first transformed data ŷ(k₁,n₂) output according to inputsymmetries imposed on the first-phase DFT (i.e., 3-point DFT in the caseof 33-point DFT and 5-point DFT in the case of 65-point DFT). Suchsymmetries are provided by matrices P and Q of any one of theaforementioned Equations 6 to 9 and described by Equations 25 and 26.Case 1)x(0,n ₂)=0,x(2,n ₂)=−x(1,n ₂)Case 2)x(0,n ₂)=−x(0,n′ ₂),x(1,n ₂)=−x(2,n ₂),x(2,n′ ₂)=−x(1,n′ ₂) forsome n′ ₂  [Equation 25]Case 1)x(0,n ₂)=0,x(3,n ₂)=−x(2,n ₂),x(4,n ₂)=−x(1,n ₂)Case 2)x(0,n ₂)=−x(0,n′ ₂),x(1,n ₂)=−x(4,n′2),x(2,n ₂)=−x(3,n′2),x(3,n₂)=−x(2,n′ ₂),x(4,n ₂)=x(1,n ₂) for some n′2  [Equation 26]

Furthermore, first-phase output relationships in ŷ(k₁,n₂) arerepresented by Equations 27 and 28.ŷ _(R)(2,n ₂)=ŷ _(R)(1,n ₂)ŷ _(I)(0,n ₂)=0,ŷ _(I)(2,n ₂)=−ŷ _(I)(1,n ₂)  [Equation 27]ŷ _(R)(3,n ₂)=ŷ _(R)(2,n ₂),ŷ _(R)(4n ₂)=ŷ _(R)(1,n ₂)ŷ _(I)(0,n ₂)=0,ŷ _(I)(3,n ₂)=−(2,n ₂),ŷ _(I)(4,n ₂)=−ŷ _(I)(1,n₂)  [Equation 28]

Equations 25 and 27 represent a relationship in 3-point FFT belonging to33-point DFT and Equations 26 and 28 represent a relationship in 5-pointFFT belonging to 65-point DFT.

For example, in Equations 25 and 26, Case 1 occurs when n₂=0 and Case 2occurs when n₂=11−n′₂, n′₂==1, 2, . . . , 10 (n₂=13−n′₂, n′₂=1, 2, . . ., 12). Real parts of all outputs from 3-point FFT (S-point FFT) become 0for inputs of Case 1, and one (two) imaginary part output needs to bekept because the present disclosure can recover the remaining one output(two outputs) according to Equations 27 and 28.

A relationship between ŷ(k₁,n₂) and ŷ(k₁,n′₂) as represented by Equation29 is obtained due to input patterns of Case 2 in Equations 25 and 26.ŷ _(R)(k ₁ ,n ₂)=−ŷ _(R)(k ₁ ,n′ ₂)ŷ _(I)(k ₁ ,n ₂)=ŷ _(I)(k ₁ ,n′ ₂)  [Equation 29]

In the case of Equation 29, relationships between indexes n₂=11−n′₂,n′₂=1, 2, . . . , 10 (n₂=13−n′₂, n′₂=1, 2, . . . , 12) of 11-point FFT(13-point FFT) are equally applied.

Accordingly, the present disclosure performs 3-point FFT (S-point FFT)only when n₂ falls within a range of [0, 5]([0, 6]) according toEquation 29, and thus, the amount of associated calculation can bereduced.

In addition, since other parts of outputs can be recovered according toEquation 21 in each 3-point FFT (S-point FFT) calculation over a rangeof [1, 5]([1, 6]) only some outputs which are two (three) real partoutputs and one (two) imaginary part output are calculated.

Due to symmetries present in the first-phase outputs (Equation 29),outputs calculated from an outer loop (second-phase FFT) in Equations 13and 14 are symmetrically arranged, which can reduce the amount ofcalculation. Input patterns of the outer loop (second-phase FFT) are asin Equations 30 to 33.1)Real partŷ _(R)(k ₁,0=0,ŷ _(R)(k ₁,6)=−ŷ _(R)(k ₁,5),ŷ _(R)(k ₁,7)=−ŷ_(R)(k ₁,4),ŷ _(R)(k ₁,8)=−ŷ _(R)(k ₁,3),ŷ _(R)(k ₁,9)=−ŷ _(R)(k ₁,2),ŷ_(R)(k ₁,10)=−ŷ _(R)(k ₁,1)  [Equation 30]1)Real partŷ _(R)(k ₁,0))=0,ŷ _(R)(k ₁,7)=−ŷ _(R)(k ₁,6),ŷ _(R)(k₁,8)=−ŷ _(R)(k ₁,5),ŷ _(R)(k ₁,9)=−ŷ _(R)(k ₁,4),ŷ _(R)(k ₁,10)=−ŷ_(R)(k ₁,3),ŷ _(R)(k ₁,11)=−ŷ _(R)(k ₁,2),ŷ _(R)(k ₁,12)=−ŷ _(R)(k₁,1)  [Equation 31]2)Imaginary partŷ _(I)(k ₁,6)=ŷ _(I)(k ₁,5),ŷ _(I)(k ₁,7)=ŷ _(I)(k₁,4),ŷ _(I)(k ₁,8)=ŷ _(I)(k ₁,3),ŷ _(I)(k ₁,9)=ŷ _(I)(k ₁,2),ŷ _(I)(k₁,10)=ŷ _(I)(k ₁,1)  [Equation 32]2)Imaginary partŷ _(I)(k ₁,7)=ŷ _(I)(k ₁,6),ŷ _(I)(k ₁,8)=ŷ _(I)(k₁,5),ŷ _(I)(k ₁,9)=ŷ _(I)(k ₁,4),ŷ _(I)(k ₁,10)=ŷ _(I)(k ₁,3),ŷ _(I)(k₁,11)=ŷ _(I)(k ₁,2),ŷ _(I)(k ₁,12)=ŷ _(I)(k ₁,1)  [Equation 33]

Equations 30 and 32 represent input symmetries encountered in 11-pointFFT belonging to 33-point FFT.

Equations 31 and 33 represent input symmetries encountered in 13-pointFFT belonging to 65-point FFT. Other symmetries are encountered in inputsets of 11-point FFT (13-point FFT) according to outer loop iterationand allow output recovery for iteration from one of previous iterations.

In the present disclosure, when the vector of ŷ(k₁,n₂) is represented asŶ(k₁)=[ŷ(k₁,0) ŷ(k₁,1) . . . ŷ(k₁,N₂−1)]^(T)=Ŷ_(R)(k₁)+j·Ŷ_(I)(k₁),input symmetries present in an iteration process may be represented byEquation 34.Case 1:ŷ _(I)(k ₁)=0Case 2:Ŷ _(R)(k ₁)=Ŷ _(R)(k′ ₁),Ŷ _(I)(k ₁)=−Ŷ _(I)(k′ ₁)  [Equation 34]

In two-dimensional DFT such as 33-point FFT (65-point FFT), k₁ has arange of [0, 2]([0,4]).

In Equation 34, Case 1 occurs only when k₁=0. In Equation 34, Case 2occurs when k₁=3−k′₁, k′₁=1,2 (k₁=5−k′₁, k′₁=1,2,3,4).

Since an output of skipped iteration can be derived from one of previousiterations from the symmetries in Equation 34, the number of effectiveiterations of 11-point FFT (15-point FFT) in 33-point FFT (65-point FFT)can be reduced from 3(5) to 2(3).

Furthermore, the present disclosure can take only imaginary parts amongoutputs from 33-point FFT (65-point FFT) according to Equations 6 to 9,and thus output patterns of the cases in Equation 34 may be representedby Equations 35 to 38.Case 1:{circumflex over (X)} _(I)(k ₁,0)=0,{circumflex over (X)} _(I)(k₁,11−k ₂)=−{circumflex over (X)} _(I)(k ₁ ,k ₂),k ₂=1,2, . . .,10  [Equation 35]Case 1:{circumflex over (X)} _(I)(k ₁,0)=0,{circumflex over (X)} _(I)(k₁,13−k ₂)={circumflex over (X)} _(I)(k ₁ ,k ₂),k ₂=1,2, . . .,12  [Equation 36]Case 2:{circumflex over (X)} _(I)(k ₁,0)=−{circumflex over (X)} _(I)(3−k₁,0),{circumflex over (X)} _(I)(k ₁ ,k ₂)=−{circumflex over (X)}_(I)(3−k ₁,11−k ₂),k ₁=1,2,k ₂=1,2, . . . ,10  [Equation 37]Case 2:{circumflex over (X)} _(I)(k ₁,0)=−{circumflex over (X)} _(I)(5−k₁,0),{circumflex over (X)} _(I)(k ₁ ,k ₂)=−{circumflex over (X)}_(I)(5−k ₁,13−k ₂),k ₁=1,2,3,4,k ₂=1,2, . . . ,12  [Equation 38]

Equations 35 and 37 represent output symmetries in 11-point FFTbelonging to 33-point FFT and Equations 36 and 38 represent outputsymmetries in 13-point FFT belonging to 65-point FFT.

Subsequent iterations of the outer loop in two-dimensional DFT areunnecessary due to the symmetries as represented in Equations 35 to 38.Final output Indexes k are k=2m+1 from the relationship between forwardDST7 and DFT in Equations 6 and 7. Here, the range of m is [0, 15]([0,31]) for 16×16 DST7 (32×32 DST7).

FIGS. 44 and 45 illustrate embodiments to which the present disclosureis applied, FIG. 44 is a block diagram illustrating 16×16 DST7 to which33-point DFT is applied, and FIG. 45 is a block diagram illustrating32×32 DST7 to which 65-point DFT is applied.

In an embodiment of the present disclosure, a configuration in whichgeneral DFT is used instead of Winograd FFT is proposed.

A formula for general one-dimensional DFT is given as the aforementionedEquations 7 and 8 respectively for 33-point DFT and 65-point DFT.Further, formulas for general two-dimensional DFTs corresponding to33-point one-dimensional DFT and 65-point one-dimensional DFT arerespectively given as Equations 13 and 14.

In FIGS. 44 and 45 , first-phase DFT is 3-point DFT or 5-point DFT. Ageneral DFT formula for the first-phase DFT is as follows.

$\begin{matrix}{{\hat{y}\left( {k_{1},n_{2}} \right)} = {{{{\hat{y}}_{R}\left( {k_{1},n_{2}} \right)} + {j \cdot {{\hat{y}}_{I}\left( {k_{1},n_{2}} \right)}}} = {\sum\limits_{n_{1} = 0}^{N_{1} - 1}{{\hat{x}\left( {n_{1},n_{2}} \right)}W_{N_{1}}^{n_{1}k_{1}}}}}} & \left\lbrack {{Equation}39} \right\rbrack\end{matrix}$${{\hat{y}}_{R}\left( {k_{1},n_{2}} \right)} = {\sum\limits_{n_{1} = 0}^{N_{1} - 1}{{\hat{x}\left( {n_{1},n_{2}} \right)}{\cos\left( \frac{2\pi k_{1}n_{1}}{N_{1}} \right)}}}$${{\hat{y}}_{I}\left( {k_{1},n_{2}} \right)} = {- {\sum\limits_{n_{1} = 0}^{N_{1} - 1}{{\hat{x}\left( {n_{1},n_{2}} \right)}{\sin\left( \frac{2\pi k_{1}n_{1}}{N_{1}} \right)}}}}$

Equation 39 represents 3-point DFT when N₁=3 and represents 5-point DFTwhen N₁=5. Corresponding DFT can be calculated only for a range in whichn₂ is 0 to (N₂−1)/2 according to symmetry proposed in Equation 21. Thatis, N₂=11 when N₁=3, and N₂=13 when N₁=5.

Case 1 in Equations 25 and 26 corresponds to simplified 3-point DFT Type1 of FIG. 44 and simplified 5-point DFT Type 1 of FIG. 45 , whichcorrespond to a case in which n₂=0.

Simplified 3-point DFT Type 1 is given by Equation 40.

$\begin{matrix}\begin{matrix}{{{{\hat{y}}_{R}\left( {k_{1},0} \right)} = 0},} & {{{\hat{y}}_{I}\left( {k_{1},0} \right)} = {{- 2}{\hat{x}\left( {1,0} \right)}{\sin\left( \frac{2\pi k_{1}}{3} \right)}}}\end{matrix} & \left\lbrack {{Equation}40} \right\rbrack\end{matrix}$

Since calculation is necessary only for a case in which k₁=1 in Equation40, only one multiplication is required. Simplified 5-point DFT Type 1is represented by Equation 41 in the same manner.

$\begin{matrix}{{{\hat{y_{R}}\left( {k_{1},0} \right)} = 0},{{{\hat{y}}_{I}\left( {k_{1},0} \right)} = {{{- 2}{\hat{x}\left( {1,0} \right)}{\sin\left( \frac{2\pi k_{1}}{5} \right)}} - {2{\hat{x}\left( {2,0} \right)}{\sin\left( \frac{2\pi{k_{1} \cdot 2}}{5} \right)}}}}} & \left\lbrack {{Equation}41} \right\rbrack\end{matrix}$

Since calculation is necessary only for a case in which k₁=1, 2 inEquation 41, only two multiplications are required. Further, “multiply2” in Equations 40 and 41 can be processed through a left shiftoperation and thus is not counted as multiplication.

Case 2 in Equations 25 and 26 corresponds to simplified 3-point DFT Type2 of FIG. 44 and simplified 5-point DFT Type 2 of FIG. 45 , whichcorrespond to a case in which n₂=1 to 5 and a case in which n₂=1 to 6.

Simplified 3-point DFT Type 2 can be implemented through Equation 39.Here, when symmetry of Equation 27 is used, ŷ_(R) (k₁, n₂) is obtainedonly for a case in which k₁=0, 1 and ŷ_(I)(k₁, n₂) is obtained only fora case in which k₁=1.

Likewise, simplified 5-point DFT Type 2 can be implemented throughEquation 39. Likewise, when symmetry of Equation 28 is used, ŷ_(R) (k₁,n₂) is obtained only for a case in which k₁=0, 1, 2 and ŷ_(I)(k₁, n₂) isobtained only for a case in which k₁=1, 2.

Second-phase DFT in FIGS. 44 and 45 is 11-point DFT or 13-point DFT. Ageneral DFT formula for the second-phase DFT is represented by Equation42.

$\begin{matrix}{{\hat{X}\left( {k_{1},k_{2}} \right)} = {{{{\hat{X}}_{R}\left( {k_{1},k_{2}} \right)} + {j \cdot {{\hat{X}}_{l}\left( {k_{1},k_{2}} \right)}}} = {\sum\limits_{n_{2} = 0}^{N_{2} - 1}{{\hat{y}\left( {k_{1},n_{2}} \right)}W_{N_{2}}^{n_{2}k_{2}}}}}} & \left\lbrack {{Equation}42} \right\rbrack\end{matrix}$${{\hat{X}}_{I}\left( {k_{1},k_{2}} \right)} = {\sum\limits_{n_{2} = 0}^{N_{2} - 1}\left\lbrack {{{{\hat{y}}_{I}\left( {k_{1},n_{2}} \right)}{\cos\left( \frac{2\pi k_{2}n_{2}}{N_{2}} \right)}^{n_{2} = 0}} - {{{\hat{y}}_{R}\left( {k_{1},n_{2}} \right)}{\sin\left( \frac{2\pi k_{2}n_{2}}{N_{2}} \right)}}} \right\rbrack}$

Equation 42 represents 11-point DFT when N₂=11 and represents 13-pointDFT when N₂=13. Corresponding DFT can be calculated only for a range inwhich k₁ is 0 to (N₁−1)/2 according to symmetry proposed in Equations 36to 38. N₁=2 when N₂=11, and N₁=5 when N₂=13.

Case 1 of Equation 34 and Equation 35 correspond to simplified 11-pointDFT Type 1 of FIG. 44 . In addition, Case 1 of Equation 34 and Equation36 correspond to simplified 13-point DFT Type 1.

When symmetries proposed in Equations 30 to 33 are used, simplified1-point DFT Type 1 and simplified 13-point DFT Type 1 are obtained asrepresented in Equation 43. That is, they correspond to a case in whichk₁=0.

$\begin{matrix}{{{\hat{X}}_{I}\left( {0,k_{2}} \right)} = {{\sum\limits_{n_{2} = 1}^{\frac{N_{2} - 1}{2}}{\left\lbrack {{- 2}{{\hat{y}}_{R}\left( {0,n_{2}} \right)}} \right\rbrack{\sin\left( \frac{2\pi k_{2}n_{2}}{N_{2}} \right)}}} = {{- 2}{\sum\limits_{n_{2} = 1}^{\frac{N_{2} - 1}{2}}{{{\hat{y}}_{R}\left( {0,n_{2}} \right)}{\sin\left( \frac{2\pi k_{2}n_{2}}{N_{2}} \right)}}}}}} & \left\lbrack {{Equation}43} \right\rbrack\end{matrix}$

According to Equation 43, simplified 11-point DFT Type 1 requiresmultiplication five times and simplified 13-point DFT Type 1 requiresmultiplication six times.

Similarly, when symmetries proposed in Equations 30 to 33 are used,simplified 11-point DFT Type 2 and simplified 13-point DFT Type 2 may beobtained as represented in Equation 44. Here, simplified 11-point DFTType 2 is performed when k₁=1 and simplified 13-point DFT Type 2 isperformed when k₁=1, 2.

$\begin{matrix}{{{\hat{X}}_{I}\left( {k_{1},k_{2}} \right)} = {{2\left\lbrack {\sum\limits_{n_{2} = 1}^{\frac{N_{2} - 1}{2}}{{{\hat{y}}_{I}\left( {k_{1},n_{2}} \right)}{\cos\left( \frac{2\pi k_{2}n_{2}}{N_{2}} \right)}}} \right\rbrack} + {{\hat{y}}_{I}\left( {k_{I},0} \right)} - {2\left\lbrack {\sum\limits_{n_{2} = 1}^{\frac{N_{2} - 1}{2}}{{{\hat{y}}_{R}\left( {k_{1},n_{2}} \right)}{\sin\left( \frac{2\pi k_{2}n_{2}}{N_{2}} \right)}}} \right\rbrack}}} & \left\lbrack {{Equation}44} \right\rbrack\end{matrix}$

According to Equation 44, simplified 11-point DFT Type 2 requiresmultiplication ten times and simplified 13-point DFT Type 2 requiresmultiplication twelve times.

In multiplications in Equations 40 to 44, cosine values and sine valuesare multiplied as DFT kernel coefficients. Since available values N₁ andN₂ are 3, 5, 11, and 13, coefficients in Equation 45 appear in thecorresponding multiplications. However, a case in which i=0 is excludedbecause a corresponding cosine or sine value is 0 or 1.

$\begin{matrix}{{\cos\left( \frac{2\pi i}{3} \right)},{\sin\left( \frac{2\pi i}{3} \right)},{i = 1},2} & \left\lbrack {{Equation}45} \right\rbrack\end{matrix}$${\cos\left( \frac{2\pi i}{5} \right)},{\sin\left( \frac{2\pi i}{5} \right)},{i = 1},2,3,4$${\cos\left( \frac{2\pi i}{11} \right)},{\sin\left( \frac{2\pi i}{11}\  \right)},{i = 1},2,3,4,5$${\cos\left( \frac{2\pi i}{13} \right)},{\sin\left( \frac{2\pi i}{13} \right)},{i = 1},2,3,4,5,6$

Since index n₂ increases only to (N₂−1)/2 in Equations 43 and 44, valuei is limited to (N₂−1)/2 for the last two cases in Equation 45.

The number of coefficients appearing in Equation 45 is 2×(2+4+5+6)=34,and 2×(2+5)=14 coefficients are required for 33-point DFT and 2×(2+6)=20coefficients are required for 65-point DFT. Each coefficient can beapproximated to an integer through scaling and rounding and, since inputdata of DST7 is residual data in the form of an integer, all associatedcalculations can be performed as integer calculations. Sinceintermediate results values are also scaled values, it is necessary toappropriately apply down scaling in each calculation step or outputstep.

In addition, reference order of coefficient values may vary according tovalues k₁ and k₂ because reference forms of cosine values and sinevalues are

${\cos\left( \frac{2\pi k_{1}n_{1}}{N_{1}} \right)},{\sin\left( \frac{2\pi k_{1}n_{1}}{N_{1}} \right)},{\cos\left( \frac{2\pi k_{2}n_{2}}{N_{2}} \right)},{{and}\sin{\left( \frac{2\pi k_{2}n_{2}}{N_{2}} \right).}}$

Accordingly, an order table having the values k₁ and k₂ as addresses maybe generated and reference order according to n₁ and n₂ may be obtainedin the form of a table look-up. For example, if N₂=11, k₂=3, [

k₂,n₂

_(N) ₂ ]_(N) ₂ _(=1,2, . . . 5)=[3,6,9,1,4] can be a corresponding tableentry and the table entry corresponding to all available values k₂ maybe set.

Rectangles denoted by 16 and 32 in FIGS. 44 and 45 represent datapermutation and code conversion. Simplified 3-point DFT Type 1,simplified 3-point DFT Type 2, simplified 5-point DFT Type 1, andsimplified 5-point DFT Type 2 blocks in FIGS. 44 and 45 can receivecorresponding data through index conversion represented by Equations 15and 16 and input data symmetries represented by Equations 25 and 26, andsome data is input after conversion of signs thereof due to symmetriesof Equations 25 and 26.

In embodiments of the present disclosure, simplified 3-point DFT Type 2of FIG. 44 and simplified 5-point DFT Type 2 of FIG. 45 are calculatedthrough Equation 39. More specifically, they correspond to a case inwhich n₂≠0 in Equation 39, and the absolute values of

${\cos\left( \frac{2\pi k_{1}n_{1}}{N_{1}} \right)},{{and}{\sin\left( \frac{2\pi k_{1}n_{1}}{N_{1}} \right)}}$are identical according to change in the value n₁ in many cases.Accordingly, N₁ multiplications are not required even if n₁ increasesfrom 0 to N₁−1 as in Equation 39. It is assumed that a value A/B isscaled as represented by Equation 46 for a case in which n₂≠0 inEquation 39 (i.e., in the case of simplified 3-point DFT Type 2 of FIG.44 and simplified 5-point DFT Type 2 of FIG. 45 ).

$\begin{matrix} & \left\lbrack {{Equation}46} \right\rbrack\end{matrix}$${\frac{A}{B}{{\hat{y}}_{R}\left( {k_{1},n_{2}} \right)}} = {{\frac{A}{B}{\sum\limits_{n_{1} = 0}^{N_{1} - 1}{{\hat{x}\left( {n_{1},n_{2}} \right)}{\cos\left( \frac{2\pi k_{1}n_{1}}{N_{1}} \right)}}}} = {\frac{1}{B}{\sum\limits_{n_{1} = 0}^{N_{1} - 1}{{\hat{x}\left( {n_{1},n_{2}} \right)}\left\lbrack {A{\cos\left( \frac{\left. {2\pi k_{1}n_{1}} \right)}{N_{1}} \right)}} \right\rbrack}}}}$${\frac{A}{B}{{\hat{y}}_{I}\left( {k_{1},n_{2}} \right)}} = {{{- \frac{A}{B}}{\sum\limits_{n_{1} = 0}^{N_{1} - 1}{{\hat{x}\left( {n_{1},n_{2}} \right)}{\sin\left( \frac{2\pi k_{1}n_{1}}{N_{1}} \right)}}}} = {\frac{1}{B}\left\lbrack {\sum\limits_{n_{1} = 0}^{N_{1} - 1}{{\hat{x}\left( {n_{1},n_{2}} \right)}\left\lbrack {A{\sin\left( \frac{\left. {2\pi k_{1}n_{1}} \right)}{N_{1}} \right)}} \right\rbrack}} \right\rbrack}}$

Since

${\cos\left( \frac{2\pi k_{1}n_{1}}{N_{1}} \right)}{or}{}{\sin\left( \frac{2\pi k_{1}n_{1}}{N_{1}} \right)}$is a floating-point number having an absolute value equal to or greaterthan 1 as represented by Equation 46, an integer value or afloating-point number having sufficient accuracy can be generated whenthe value A is appropriately multiplied. 1/B that is finally multipliedin Equation 46 can be calculated only using a shift operation accordingto the value B. Details with respect thereto will be described later inembodiment 7.

When A/2B is multiplied instead of A/B in Equations 40 and 41, Equations47 and 48 are obtained.

$\begin{matrix}{{{\frac{A}{2B}{\hat{y}}_{R}\left( {k_{1},0} \right)} = 0},{{\frac{A}{2B}{{\hat{y}}_{I}\left( {k_{1},0} \right)}} = {\frac{1}{B}\left\lbrack {- {{x\left( {1,0} \right)}\left\lbrack {A{\sin\left( \frac{2\pi k_{1}}{3} \right)}} \right\rbrack}} \right\rbrack}}} & \left\lbrack {{Equation}47} \right\rbrack\end{matrix}$ $\begin{matrix}{{\frac{A}{2B}{\hat{y}}_{R}\left( {k_{1},0} \right)} = {{0,{{\frac{A}{2B}{{\hat{y}}_{I}\left( {k_{1},0} \right)}} = {\frac{1}{B}\left\lbrack {{- {{\hat{x}\left( {1,0} \right)}\left\lbrack {A{\sin\left( \frac{2\pi k_{1}}{5} \right)}} \right\rbrack}} - {{}{{\text{⁠}{{\hat{x}\left( {2,0} \right)}\text{⁠}\left\lbrack {A{\sin\left( \frac{2\pi k_{1}}{5} \right)}} \right\rbrack}}}}} \right\rbrack}}}}} & \left\lbrack {{Equation}48} \right\rbrack\end{matrix}$

In Equations 47 and 48, an integer value or a floating-point numberhaving sufficient accuracy can be generated by multiplying

${\cos\left( \frac{2\pi k_{1}n_{1}}{N_{1}} \right)}{or}{\sin\left( \frac{2\pi k_{1}n_{1}}{N_{1}} \right)}$by A, and 1/B that is finally multiplied can be calculated only usingshift operation according to the value B. Details with respect theretowill be described later.

Simplified 11-point DFT Type 1 and Simplified 13-point DFT Type 1perform operation (corresponding to a case in which k₁=0) described inEquation 43, and Equation 49 can be obtained when a value C/2D ismultiplied as a scaling value.

$\begin{matrix}{{\frac{C}{2D}{{\hat{X}}_{I}\left( {0,k_{2}} \right)}} = {\frac{1}{D}{\sum\limits_{n_{2} = 1}^{\frac{N_{2} - 1}{2}}{\left\lbrack {- {{\hat{y}}_{R}\left( {0,n_{2}} \right)}} \right\rbrack\left\lbrack {C{\sin\left( \frac{2\pi k_{2}n_{2}}{N_{2}} \right)}} \right\rbrack}}}} & \left\lbrack {{Equation}49} \right\rbrack\end{matrix}$${\frac{A}{B}\frac{C}{2D}{{\overset{\hat{}}{X}}_{I}\left( {0,k_{2}} \right)}} = {\frac{1}{D}{\sum\limits_{n_{2} = 1}^{\frac{N_{2} - 1}{2}}{\left\lbrack {{- \frac{A}{B}}{{\overset{\hat{}}{y}}_{R}\left( {0,n_{2}} \right)}} \right\rbrack\left\lbrack {C{\sin\left( \frac{2\pi k_{2}n_{2}}{N_{2}} \right)}} \right\rbrack}}}$

Since

$\sin\left( \frac{2\pi k_{2}n_{2}}{N_{2}} \right)$can be multiplied by C as in Equation 49, integer or fixed pointoperation can be applied. When A/B that is the scaling value multipliedin Equation 46 is considered, a total scaling value multiplied by{circumflex over (X)}_(I)(0,k₂) that is one piece of final result databecomes

$\frac{A}{B}\frac{C}{2D}$as represented in Equation 49. Further

$\frac{A}{B}{{\hat{y}}_{R}\left( {0,n_{2}} \right)}$calculated from Equation 46 can be directly applied as an input asrepresented in Equation 49.

Simplified 11-point DFT Type 2 and simplified 13-point DFT Type 2 arecalculated through Equation 44 (simplified 11-point DFT Type 2 isperformed when k₁=1 and simplified 13-point DFT Type 2 is performed whenk₁=1, 2), and Equation 50 is obtained when C/2D is multiplied as ascaling value as in Equation 49.

$\begin{matrix}{{\frac{C}{2D}{{\hat{X}}_{I}\left( {k_{1},k_{2}} \right)}} = {\left\lbrack {\frac{1}{D}{\sum\limits_{n_{2} = 1}^{\frac{N_{2} - 1}{2}}{{{\hat{y}}_{I}\left( {k_{1},n_{1}} \right)}\left\lbrack {C{\cos\left( \frac{2\pi k_{2}n_{2}}{N_{2}} \right)}} \right\rbrack}}} \right\rbrack + {\frac{C}{2D}{{\hat{y}}_{I}\left( {k_{1},0} \right)}} + \left\lbrack {\frac{1}{D}{\sum\limits_{n_{2} = 1}^{\frac{N_{2} - 1}{2}}{\left\lbrack {- {{\hat{y}}_{R}\left( {k_{1},n_{2}} \right)}} \right\rbrack\left\lbrack {C{\sin\left( \frac{2\pi k_{2}n_{2}}{N_{2}} \right)}} \right\rbrack}}} \right\rbrack}} & \left\lbrack {{Equation}50} \right\rbrack\end{matrix}$${\frac{A}{B}\text{⁠}\frac{C}{2D}{{\hat{X}}_{I}\left( {k_{1},k_{2}} \right)}} = {\left\lbrack {\frac{1}{D}{\sum\limits_{n_{2} = 1}^{\frac{N_{2} - 1}{2}}{{{\overset{\sim}{y}}_{I}\left( {k_{1},n_{2}} \right)}\left\lbrack {C{\cos\left( \frac{2\pi k_{2}n_{2}}{N_{2}} \right)}} \right\rbrack}}} \right\rbrack + {\left\lbrack {\frac{1}{D}{\sum\limits_{n_{2} = 1}^{\frac{N_{2} - 1}{2}}{\left\lbrack {{- \frac{A}{B}}{{\hat{y}}_{R}\left( {k_{1},n_{2}} \right)}} \right\rbrack\left\lbrack {C{\sin\left( \frac{2\pi k_{2}n_{2}}{N_{2}} \right)}} \right\rbrack}}} \right\rbrack}}$${{where}{}{{\overset{\sim}{y}}_{I}\left( {k_{1},n_{2}} \right)}} = \left\{ \begin{matrix}{{\frac{A}{2B}{{\hat{y}}_{I}\left( {k_{1},0} \right)}},} & {{{if}n_{2}} = 0} \\{{\frac{A}{B}{\hat{y}}_{I}\left( {k_{1},n_{2}} \right)},} & {otherwise}\end{matrix} \right.$

It can be confirmed that

${\sin\left( \frac{2\pi k_{2}n_{2}}{N_{2}} \right)}{and}{\cos\left( \frac{2{nk}_{2}n_{2}}{N_{2}} \right)}$are multiplied by C in Equation 50 as in Equation 49. Accordingly, theinteger or a floating-point operation can be used to multiply a cosinevalue by a sine value. When A/B multiplied in Equation 46 and A/2Bmultiplied in Equations 47 and 48 are considered together as in Equation49, the second equation in Equation 50 is obtained. When {tilde over(y)}_(I)(k₁,n₂) is defined as represented by Equation 50, valuesobtained through Equations 46 to 48 can be used as input data ofEquation 50.

Available values k₂ in Equation 50 are 0 to 10 in the case of simplified11-point DFT Type 2 and 0 to 12 in the case of simplified 13-point DFTType 2. Relations such as Equation 51 are established due to symmetrybasically present in a cosine value and a sine value.

$\begin{matrix}{{f\left( {k_{1},k_{2}} \right)} = {\frac{1}{D}{\sum\limits_{n_{2} = 1}^{\frac{N_{2} - 1}{2}}{{{\overset{\sim}{y}}_{I}\left( {k_{1},n_{2}} \right)}\left\lbrack {C{\cos\left( \frac{2\pi k_{2}n_{2}}{N_{2}} \right)}} \right\rbrack}}}} & \left\lbrack {{Equation}51} \right\rbrack\end{matrix}$${g\left( {k_{1},k_{2}} \right)} = {\frac{1}{D}{\sum\limits_{n_{2} = 1}^{\frac{N_{2} - 1}{2}}{\left\lbrack {{- \frac{A}{B}}{{\hat{y}}_{R}\left( {k_{1},n_{2}} \right)}} \right\rbrack\left\lbrack {C{\sin\left( \frac{2{nk}_{2}n_{2}}{N_{2}} \right)}} \right\rbrack}}}$${\frac{A}{B}\frac{C}{2D}{{\hat{X}}_{I}\left( {k_{1},k_{2}} \right)}} = {{{f\left( {k_{1},k_{2}} \right)} + {g\left( {k_{1},k_{2}} \right)}} = {h\left( {k_{1},k_{2}} \right)}}$${h\left( {k_{1},k_{2}} \right)} = \left\{ \begin{matrix}{{f\left( {k_{1},k_{2}} \right)},} & {k_{2} = 0} \\{{{f\left( {k_{1},k_{2}} \right)} + {g\left( {k_{1},k_{2}} \right)}},} & {1 \leq k_{2} \leq \frac{N_{2} - 1}{2}} \\{{{f\left( {{k_{1}N_{2}} - k_{2}} \right)} - {g\left( {k_{1},{N_{2} - k_{2}}} \right)}},} & {\frac{N_{2} + 1}{2} \leq k_{2} \leq {N_{2} - 1}}\end{matrix} \right.$

In Equation 51, N₂ for simplified 11-point DFT Type 2 is 11 and N₂ forsimplified 13-point DFT Type 2 is 13. All identifiers appearing inEquation 51 are defined as in Equation 50.

Accordingly, only the range of

$0 \leq k_{2} \leq \frac{N_{2} - 1}{2}$can be calculated for ƒ(k₁,k₂) and only the range of

$1 \leq k_{2} \leq \frac{N_{2} - 1}{2}$can be calculated for g(k₁,k₂) as in Equation 51. With respect toEquation 49, only the range of

$1 \leq k_{2} \leq \frac{N_{2} - 1}{2}$can be calculated due to symmetry for k₂ according to the sameprinciple.

In an embodiment of the present disclosure, all the aforementionedscaling values have a form of A/B,

${\cos\left( \frac{2\pi{kn}}{N} \right)}{or}{\sin\left( \frac{2\pi{kn}}{N} \right)}$is multiplied by A first such that integer operation can be performedand then multiplied by 1/B. Further, since the number of cosine valuesand sine values appearing in all equations is limited as in Equation 45,corresponding cosine values and sine values are multiplied by A inadvance and stored in an array or a ROM such that they can be usedthrough in a table look-up manner. Equation 46 may be represented asEquation 52.

$\begin{matrix}\begin{matrix}{{\frac{A}{B}{\hat{y}}_{R}\left( {k_{1},n_{2}} \right)} = {\frac{1}{B}{\sum\limits_{n_{1} = 0}^{N_{1} - 1}{\hat{x}{\left( {n_{1},n_{2}} \right)\left\lbrack {A\cos\left( \frac{2\pi k_{1}n_{1}}{N_{1}} \right)} \right\rbrack}}}}} \\{{\frac{A}{B}{\hat{y}}_{I}\left( {k_{1},n_{2}} \right)} = {\frac{1}{B}\left\lbrack {\sum\limits_{n_{1} = 0}^{N_{1} - 1}{{\hat{x}\left( {n_{1},n_{2}} \right)}\left\lbrack {A{\sin\left( \frac{2\pi k_{1}n_{1}}{N_{1}} \right)}} \right\rbrack}} \right\rbrack}}\end{matrix} & \left\lbrack {{Equation}52} \right\rbrack\end{matrix}$

Here, when

$A{\cos\left( \frac{2\pi{kn}}{N} \right)}{or}A{\sin\left( \frac{2\pi{kn}}{N} \right)}$is multiplied by a sufficiently large value as A and then rounded off,it is possible to maintain sufficient accuracy of cosine or sine valueswhile modifying the cosine or sine values into scaled integer values. Apower of 2 (2n) may be generally used as the value A. For example

$A{\cos\left( \frac{2\pi{kn}}{N} \right)}{or}A{\sin\left( \frac{2\pi{kn}}{N} \right)}$can be approximated through a method represented by Equation 53.

$\begin{matrix}{{2^{n}{\cos\left( \frac{2\pi{kn}}{N} \right)}} \approx {{round}\left( {2^{\prime\prime}{\cos\left( \frac{2\pi{kn}}{N} \right)}} \right)}} & \left\lbrack {{Equation}53} \right\rbrack\end{matrix}$

In Equation 53, round represents a rounding operator. While any roundingmethod for conversion into an integer can be used, conventional roundingoff based on 0.5 can be used.

Multiplying by 1/B (i.e., dividing by B) in Equation 52 can beimplemented through right shift operation when B is a power of 2. WhenB=2m, multiplication for 1/B can be approximated as in Equation 54.Here, rounding can be considered as in Equation 54, but the presentdisclosure is not limited thereto.

$\begin{matrix}{\frac{x}{2^{m}} \approx \left\{ \begin{matrix}{x \gg m_{,}} & {{when}{rounding}{is}{not}{considered}} \\\left( {{{x + \left( {1 \ll \left( {m - 1} \right)} \right)} \gg m},} \right. & {{when}{rounding}{is}{considered}}\end{matrix} \right.} & \left\lbrack {{Equation}54} \right\rbrack\end{matrix}$

Meanwhile, the multiplied value A need not necessarily be a power of 2as represented in Equation 53. Particularly, when a scaling factor inthe form of

$\frac{1}{\sqrt{N}}$needs to be additionally multiplied, this can be reflected in the valueA.

For example, since values multiplied as numerators in Equations 49 to 51are A and C, one of A and C may be multiplied by

$\frac{1}{\sqrt{N}}$or A may be multiplied by α and C may be multiplied by β when

$\frac{1}{\sqrt{N}} = {{\alpha\beta}.}$As an example in which A is not a power, a value such as

$2^{\frac{1}{2}}$may be additionally multiplied because a case in which

$2^{\frac{1}{2}}$is additionally multiplied in order to equally maintain ranges of kernelcoefficient values for transforms of all sizes in a CODEC system towhich the present disclose is applied occurs.

In a similar manner, the aforementioned Equations 40, 41, 43, and 44 canbe appropriately approximated to simple operations of Equations 55 to58, respectively.

$\begin{matrix}\begin{matrix}{{{\frac{A}{2B}{\hat{y}}_{R}\left( {k_{1},0} \right)} = 0},} & {{\frac{A}{2B}{\hat{y}}_{I}\left( {k_{1},0} \right)} = {\frac{1}{B}\left\lbrack {- {{\hat{x}\left( {1,0} \right)}\left\lbrack {A{\sin\left( \frac{2\pi k_{1}}{3} \right)}} \right\rbrack}} \right\rbrack}}\end{matrix} & \left\lbrack {{Equation}55} \right\rbrack\end{matrix}$ $\begin{matrix}{{{\frac{A}{2B}{{\hat{y}}_{R}\left( {k_{1},0} \right)}} = 0},{{\frac{A}{2B}{{\hat{y}}_{1}\left( {k_{1},0} \right)}} = {\frac{1}{B}\left\lbrack {{- {{\hat{x}\left( {1,0} \right)}\left\lbrack {A{\sin\left( \frac{2\pi k_{1}}{5} \right)}} \right\rbrack}} - {{\hat{x}\left( {2,0} \right)}\left\lbrack {A{\sin\left( \frac{2\pi k_{1}}{5} \right)}} \right\rbrack}} \right\rbrack}}} & \left\lbrack {{Equation}56} \right\rbrack\end{matrix}$ $\begin{matrix}{{\frac{A}{B}\frac{C}{2D}{{\hat{X}}_{I}\left( {0,k_{2}} \right)}} = {\frac{1}{D}{\sum\limits_{n_{2} = 0}^{\frac{N_{2} - 1}{2}}{\left\lbrack {{- \frac{A}{B}}{{\hat{y}}_{R}\left( {0,n_{2}} \right)}} \right\rbrack\left\lbrack {C{\sin\left( \frac{2\pi k_{2}n_{2}}{N_{2}} \right)}} \right\rbrack}}}} & \left\lbrack {{Equation}57} \right\rbrack\end{matrix}$ $\begin{matrix}{{{f\left( {k_{1},k_{2}} \right)} = {\frac{1}{D}{\sum\limits_{n_{2} = 0}^{\frac{N_{2} - 1}{2}}{{{\overset{\sim}{y}}_{I}\left( {k_{1},n_{2}} \right)}\left\lbrack {C{\cos\left( \frac{2\pi k_{2}n_{2}}{N_{2}} \right)}} \right\rbrack}}}},{{g\left( {k_{1},k_{2}} \right)} = {\frac{1}{D}{\sum\limits_{n_{2} = 1}^{\frac{N_{2} - 1}{2}}{\left\lbrack {{- \frac{A}{B}}{{\overset{\sim}{y}}_{R}\left( {k_{1},n_{2}} \right)}} \right\rbrack\left\lbrack {C{\sin\left( \frac{2\pi k_{2}n_{2}}{N_{2}} \right)}} \right\rbrack}}}}} & \left\lbrack {{Equation}58} \right\rbrack\end{matrix}$${\frac{A}{B}\frac{C}{2D}{{\hat{X}}_{I}\left( {k_{1},k_{2}} \right)}} = \left\{ \begin{matrix}{{f\left( {k_{1},k_{2}} \right)},} & {k_{2} = 0} \\{{{f\left( {k_{1},k_{2}} \right)} + {g\left( {k_{1},k_{2}} \right)}},} & {1 \leq k_{2} \leq \frac{N_{2} - 1}{2}} \\{{{f\left( {k_{1},{N_{2} - k_{2}}} \right)} - {g\left( {k_{1},{N_{2} - k_{2}}} \right)}},} & {\frac{N_{2} + 1}{2} \leq k_{2} \leq {N_{2} - 1}}\end{matrix} \right.$${{where}{{\overset{\sim}{y}}_{l}\left( {k_{1},n_{2}} \right)}} = \left\{ \begin{matrix}{{\frac{A}{2B}{{\hat{y}}_{l}\left( {k_{1},0} \right)}},} & {{{if}n_{2}} = 0} \\{{\frac{A}{B}{{\hat{y}}_{l}\left( {k_{1},n_{2}} \right)}},} & {otherwise}\end{matrix} \right.$

Here, since ƒ(k₁, k₂) and g(k₁, k₂) can be calculated only in partialranges

$\left. {\left. \left( \left\lbrack {0,\frac{N_{2} - 1}{2}} \right. \right. \right\rceil{{and}{}\left\lbrack {1,\frac{N_{2} - 1}{2}} \right\rbrack}} \right)$due to symmetry, complexity can be substantially reduced.

Furthermore, approximation for multiplying by A and approximation formultiplying by 1/B may also be applied to Equations 47 to 51.

An example of approximate implementation for scaling factormultiplication in length-8, 16, and 32 DST7 is shown in Table 45. A, B,C, and D in Table 45 are identical to A, B, C, and D in Equations 46 to51, and “shift” is a value input to a DST7 function as a factor and maybe a value determined according to a method of executing quantization(or inverse quantization) performed after transform (or before inversetransform).

TABLE 45 Config. Original Approximation 8 × 8 DST7 17-Pt${A{\sin\left( \frac{2\pi k}{17} \right)}},{k = 1},2,\ldots,8$${{round}\left\{ {\frac{1}{\sqrt{17}} \cdot 2^{\frac{1}{2}} \cdot {\sin\left( \frac{2\pi k}{17} \right)} \cdot 2^{10}} \right\}},{k = 1},2,\ldots,8$DFT 1/B = 2^(−shift) (x + (1 << (shift − 1)) >> shift 16 × 16 DST7  3-ptDFT ${A{\sin\left( \frac{2\pi k}{3} \right)}},{k = 1}$${{round}\left\{ {{\sin\left( \frac{2\pi k}{3} \right)} \cdot 2^{9}} \right\}},{k = 1}$1/B = 2⁻¹⁰ (x + (1 << 9) >> 10 11-pt DFT${C{\sin\left( \frac{2\pi k}{11} \right)}},{k = 1},2,\ldots,5$${{round}\left\{ {\frac{1}{\sqrt{33}} \cdot {\sin\left( \frac{2\pi k}{11} \right)} \cdot 2^{11}} \right\}},{k = 1},2,\ldots,5$${C{\cos\left( \frac{2\pi k}{11} \right)}},{k = 0},1,\ldots,5$${{round}\left\{ {\frac{1}{\sqrt{33}} \cdot {\cos\left( \frac{2\pi k}{11} \right)} \cdot 2^{11}} \right\}},{k = 0},1,\ldots,5$1/D = 2^(−(shift−1)) (x + (1 << (shift − 2)) >> (shift − 1) 32 × 32 DST7 5-pt DFT ${A{\sin\left( \frac{2\pi k}{5} \right)}},{k = 1},2$${{round}\left\{ {{\sin\left( \frac{2{\pi k}}{5} \right)} \cdot 2^{9}} \right\}},{k = 1},2$${A{\cos\left( \frac{2\pi k}{5} \right)}},{k = 1},2$${{round}\left\{ {{\cos\left( \frac{2\pi k}{5} \right)} \cdot 2^{9}} \right\}},{k = 1},2$1/B = 2⁻¹⁰ (x + (1 << 9) >> 10 13-pt DFT${C{\sin\left( \frac{2\pi k}{13} \right)}},{k = 1},2,\ldots,6$${{round}\left\{ {\frac{1}{\sqrt{65}} \cdot 2^{\frac{1}{2}} \cdot {\sin\left( \frac{2\pi k}{13} \right)} \cdot {2}^{11}} \right\}},{k = 1},2,\ldots,6$${C{\cos\left( \frac{2\pi k}{13} \right)}},{k = 0},1,\ldots,6$${{round}\left\{ {\frac{1}{\sqrt{65}} \cdot 2^{\frac{1}{2}} \cdot {\cos\left( \frac{2\pi k}{13} \right)} \cdot {2}^{11}} \right\}},{k = 0},1,\ldots,6$1/D = 2^(−(shift−1)) (x + (1 << (shift − 2)) >> (shift − 1)

Table 46 shows an example in which scaling values different from thosein Table 45 are applied. That is, scaling values obtained by multiplyingscaling values in Table 45 by ¼ are used.

TABLE 46 Config. Original Approximation 8 × 8 DST7 17-pt DFT${A{\sin\left( \frac{2\pi k}{17} \right)}},{k = 1},2,\ldots,8$${{round}\left\{ {\frac{1}{\sqrt{17}} \cdot 2^{\frac{1}{2}} \cdot {\sin\left( \frac{2\pi k}{17} \right)} \cdot 2^{8}} \right\}},{k = 1},2,\ldots,8$1/B = 2^(−shift) (x + (1 << (shift − 1)) >> shift 16 × 16 DST7  3-pt DFT${A{\sin\left( \frac{2\pi k}{3} \right)}},{k = 1}$${{round}\left\{ {{\sin\left( \frac{2\pi k}{3} \right)} \cdot 2^{7}} \right\}},{k = 1}$1/B = 2⁻¹⁰ (x + (1 << 7) >> 8 11-pt DFT${C{\sin\left( \frac{2\pi k}{11} \right)}},{k = 1},2,\ldots,5$${{round}\left\{ {\frac{1}{\sqrt{33}} \cdot {\sin\left( \frac{2\pi k}{11} \right)} \cdot 2^{9}} \right\}},{k = 1},2,\ldots,5$${C{\cos\left( \frac{2\pi k}{11} \right)}},{k = 0},1,\ldots,5$${{round}\left\{ {\frac{1}{\sqrt{33}} \cdot {\cos\left( \frac{2\pi k}{11} \right)} \cdot 2^{9}} \right\}},{k = 0},1,\ldots,5$1/D = 2^(−(shift−1)) (x + (1 << (shift − 2)) >> (shift − 1) 32 × 32 DST7 5-pt DFT ${A{\sin\left( \frac{2\pi k}{5} \right)}},{k = 1},2$${{round}\left\{ {{\sin\left( \frac{2\pi k}{5} \right)} \cdot 2^{7}} \right\}},{k = 1},2$${A{\cos\left( \frac{2\pi k}{5} \right)}},{k = 1},2$${{round}\left\{ {{\cos\left( \frac{2\pi k}{5} \right)} \cdot 2^{7}} \right\}},{k = 1},2$1/B = 2⁻¹⁰ (x + (1 << 7)) >> 8 13-pt DFT${C{\sin\left( \frac{2\pi k}{13} \right)}},{k = 1},2,\ldots,6$${{round}\left\{ {\frac{1}{\sqrt{65}} \cdot 2^{\frac{1}{2}} \cdot {\sin\left( \frac{2\pi k}{13} \right)} \cdot 2^{9}} \right\}},{k = 1},2,\ldots,6$${C{\cos\left( \frac{2\pi k}{13} \right)}},{k = 0},1,\ldots,6$${{round}\left\{ {\frac{1}{\sqrt{65}} \cdot 2^{\frac{1}{2}} \cdot {\cos\left( \frac{2\pi k}{13} \right)} \cdot 2^{9}} \right\}},{k = 0},1,\ldots,6$1/D = 2^(−(shift−1)) (x + (1 << (shift − 2)) >> (shift − 1)

FIG. 46 is a flowchart illustrating encoding of performing forwarddiscrete sine transform-7 (DST7) and forward discrete cosine transform-8(DCT8) through discrete Fourier transform (DFT) as an embodiment towhich the present disclosure is applied.

An encoder may determine (or select) a horizontal transform and/or avertical transform based on at least one of a prediction mode, a blockshape, and a block size of a current block (S4610).

The encoder may determine an optimal horizontal transform and/or anoptimal vertical transform through rate distortion (RD) optimization.The optimal horizontal transform and/or the optimal vertical transformmay correspond to one of a plurality of transform combinations, and theplurality of transform combinations may be defined by transform indexes.

The encoder may signal transform indexes corresponding to the optimalhorizontal transform and/or the optimal vertical transform (S4620).Here, the transform indexes may be applied to other embodimentsdescribed in the present disclosure.

As another example, a horizontal transform index for the optimalhorizontal transform and a vertical transform index for the optimalvertical transform may be independently signaled.

The encoder may perform forward transform on the current block in thehorizontal direction using the optimal horizontal transform (S4630).Here, the current block may refer to a transform block and the optimalhorizontal transform may be forward DCT8.

In addition, the encoder may perform forward transform on the currentblock in the vertical direction using the optimal vertical transform(S4640). Here, the optimal vertical transform may be forward DST7, andforward DST7 may be designed as DFT.

Although the horizontal transform is performed and then the verticaltransform is performed in the present embodiment, the present disclosureis not limited thereto. That is, the vertical transform may be performedfirst and then the horizontal transform may be performed.

The encoder may generate a transform coefficient block by performingquantization on the current block (S4650).

The encoder may perform entropy encoding on the transform coefficientblock to generate a bitstream.

FIG. 47 is a flowchart illustrating decoding of performing inversediscrete sine transform-7 (DST7) and inverse discrete cosine transform-8(DCT8) through discrete Fourier transform (DFT) as an embodiment towhich the present disclosure is applied.

A decoder may obtain transform indexes from a bitstream (S4710). Here,the transform indexes may be applied to other embodiments described inthe present disclosure.

The decoder may derive a horizontal transform and a vertical transformcorresponding to the transform indexes (S4720).

However, steps S4710 and S4720 are an embodiment and the presentdisclosure is not limited thereto. For example, the decoder may derivethe horizontal transform and the vertical transform based on aprediction mode, a block shape and a block size of a current block. Asanother example, the transform indexes may include a horizontaltransform index corresponding to the horizontal transform and a verticaltransform index corresponding to the vertical transform.

The decoder may perform entropy decoding on the bitstream to obtain atransform coefficient block and perform inverse quantization on thetransform coefficient block (S4730).

The decoder may perform inverse transform on the inversely quantizedtransform coefficient block in the vertical direction using the verticaltransform (S4740). Here, the vertical transform may correspond to DST7.That is, the decoder can apply inverse DST7 to the inversely quantizedtransform coefficient block.

The present disclosure provides a method for designing forward DST7and/or inverse DST7 as discrete Fourier transform (DFT).

The decoder may implement DST7 through one-dimensional DFT ortwo-dimensional DFT.

Further, the decoder may implement DST7 only using integer operation byapplying various scaling methods.

In addition, the decoder may design length-8, 16, and 32 DST7 through amethod of implementing DST7 using DFT and a method of implementing DST7only using integer operation.

In an embodiment, the decoder may derive a transform combinationcorresponding to a transform index and perform inverse transform on thecurrent block in the vertical or horizontal direction using DST7 orDCT8. Here, the transform combination may include a horizontal transformand a vertical transform, and the horizontal transform and the verticaltransform may correspond to any one of DST7 and DCT8.

In an embodiment, the present disclosure may include a step ofdistinguishing two partial vector signals for one row or one column ofDST7 when 33-point DFT is applied to DST7, and a step of applying11-point DFT type 1 or 11-point DFT type 2 to the two partial vectorsignals.

In an embodiment, when one row or one column of DST7 is represented assrc[0 . . . 15], the two partial vector signals may be distinguished assrc[0 . . . 4] and src[5 . . . 15].

In an embodiment, the present disclosure may include a step ofdistinguishing three partial vector signals for one row or one column ofDST7 when 65-point DFT is applied to DST7, and a step of applying13-point DFT type 1 or 13-point DFT type 2 to the three partial vectorsignals.

In an embodiment, when one row or one column of DST7 is represented assrc[0 . . . 31], the three partial vector signals may be distinguishedas src[0 . . . 5], src[6 . . . 18] and src[19 . . . 31].

In an embodiment, 13-point DFT type 1 may be applied to src[0 . . . 5]among the three partial vector signals, and 13-point DFT type 2 may beapplied to src[6 . . . 18] and src[19 . . . 31].

In an embodiment, one-dimensional 33-point DFT necessary for 16×16 DST7and one-dimensional 65-point DFT necessary for 32×32 DST7 may bedecomposed into equivalent two-dimensional DFTs having shorter DFTs. Inthis manner, it is possible to eliminate redundant calculation anddesign low-complexity DST7 by executing DST7 according to DFT.

In addition, the decoder may perform inverse transform in the horizontaldirection using the horizontal transform (S4750). Here, the horizontaltransform may correspond to DCT8. That is, the decoder may apply inverseDCT8 to the inversely quantized transform coefficient block.

Although the vertical transform is applied and then the horizontaltransform is applied in the present embodiment, the present disclosureis not limited thereto. That is, the horizontal transform may be appliedfirst and then the vertical transform may be applied.

In an embodiment, a combination of the horizontal transform and thevertical transform may include at least one of the embodiments of FIG. 6.

The decoder generates a residual block through step S4750 and generatesa restored block by adding the residual block to a predicted block.

Furthermore, the processing methods to which the present disclosure isapplied may be manufactured in the form of a program executed by acomputer and stored in computer-readable recording media. Multimediadata having the data structure according to the present disclosure mayalso be stored in computer-readable recording media. Thecomputer-readable recording media include all types of storage devicesand distributed storage devices in which data readable by a computer isstored. The computer-readable recording media may include a Blueray disk(BD), a universal serial bus (USB), a ROM, a PROM, an EEPROM, a RAM, aCD-ROM, a magnetic tape, a floppy disk, and an optical data storagedevice, for example. Furthermore, the computer-readable recording mediaincludes media implemented in the form of carrier waves (e.g.,transmission through the Internet). Furthermore, a bit stream generatedby the encoding method may be stored in a computer-readable recordingmedium or may be transmitted over wired/wireless communication networks.

Moreover, embodiments of the present disclosure may be implemented ascomputer program products according to program code and the program codemay be executed in a computer according to embodiment of the presentdisclosure. The program code may be stored on computer-readablecarriers.

As described above, the embodiments of the present disclosure may beimplemented and executed on a processor, a microprocessor, a controlleror a chip. For example, functional units shown in each figure may beimplemented and executed on a computer, a processor, a microprocessor, acontroller or a chip.

Furthermore, the decoder and the encoder to which the present disclosureis applied may be included in multimedia broadcasttransmission/reception apparatuses, mobile communication terminals, homecinema video systems, digital cinema video systems, monitoring cameras,video conversation apparatuses, real-time communication apparatuses suchas video communication, mobile streaming devices, storage media,camcorders, video-on-demand (VoD) service providing apparatuses, overthe top video (OTT) video systems. Internet streaming service providingapparatuses, 3D video systems, video phone video systems, medical videosystems, etc. and may be used to process video signals or data signals.For example, OTT video systems may include game consoles, Bluerayplayers, Internet access TVs, home theater systems, smartphones, tabletPCs, digital video recorders (DVRs), etc.

Furthermore, the processing methods to which the present disclosure isapplied may be manufactured in the form of a program executed by acomputer and stored in computer-readable recording media. Multimediadata having the data structure according to the present disclosure mayalso be stored in computer-readable recording media. Thecomputer-readable recording media include all types of storage devicesand distributed storage devices in which data readable by a computer isstored. The computer-readable recording media may include a Blueray disk(BD), a universal serial bus (USB), a ROM, a PROM, an EEPROM, a RAM, aCD-ROM, a magnetic tape, a floppy disk, and an optical data storagedevice, for example. Furthermore, the computer-readable recording mediaincludes media implemented in the form of carrier waves (e.g.,transmission through the Internet). Furthermore, a bit stream generatedby the encoding method may be stored in a computer-readable recordingmedium or may be transmitted over wired/wireless communication networks.

Moreover, embodiments of the present disclosure may be implemented ascomputer program products according to program code and the program codemay be executed in a computer according to embodiment of the presentdisclosure. The program code may be stored on computer-readablecarriers.

Embodiments described above are combinations of elements and features ofthe present disclosure. The elements or features may be consideredselective unless otherwise mentioned. Each element or feature may bepracticed without being combined with other elements or features.Further, an embodiment of the present disclosure may be constructed bycombining parts of the elements and/or features. Operation ordersdescribed in embodiments of the present disclosure may be rearranged.Some constructions of any one embodiment may be included in anotherembodiment and may be replaced with corresponding constructions ofanother embodiment. It is obvious to those skilled in the art thatclaims that are not explicitly cited in each other in the appendedclaims may be presented in combination as an exemplary embodiment orincluded as a new claim by a subsequent amendment after the applicationis filed.

The implementations of the present disclosure may be achieved by variousmeans, for example, hardware, firmware, software, or a combinationthereof. In a hardware configuration, the methods according to theimplementations of the present disclosure may be achieved by one or moreapplication specific integrated circuits (ASICs), digital signalprocessors (DSPs), digital signal processing devices (DSPDs),programmable logic devices (PLDs), field programmable gate arrays(FPGAs), processors, controllers, microcontrollers, microprocessors,etc.

In a firmware or software configuration, the implementations of thepresent disclosure may be implemented in the form of a module, aprocedure, a function, etc. Software code may be stored in the memoryand executed by the processor. The memory may be located at the interioror exterior of the processor and may transmit data to and receive datafrom the processor via various known means.

Those skilled in the art will appreciate that the present disclosure maybe carried out in other specific ways than those set forth hereinwithout departing from the spirit and essential characteristics of thepresent disclosure. Accordingly, the above embodiments are therefore tobe construed in all aspects as illustrative and not restrictive. Thescope of the present disclosure should be determined by the appendedclaims and their legal equivalents, not by the above description, andall changes coming within the meaning and equivalency range of theappended claims are intended to be embraced therein

INDUSTRIAL APPLICABILITY

Although exemplary aspects of the present disclosure have been describedfor illustrative purposes, those skilled in the art ill appreciate thatvarious modifications, additions and substitutions are possible, withoutdeparting from essential characteristics of the disclosure.

What is claimed is:
 1. An apparatus for decoding a video signal,comprising: a memory configured to store the video signal; and aprocessor coupled to the memory, wherein the processor is configured to:check whether a transform skip is applied to a current block; obtain atransform index specifying which transform kernels are applied alonghorizontal and vertical directions of the current block based on thatthe transform skip is not applied to the current block; determining anon-zero region based on the transform kernels specified by thetransform index, wherein the transform kernels correspond to at leastone of predefined transform types including DCT2, DST7 and DCT8; andperforming an inverse transform on the non-zero region based on thetransform kernels specified by the transform index.
 2. The apparatus ofclaim 1, wherein, based on that the transform kernels correspond toDCT2, a width of the non-zero region is determined as a smaller valuebetween a width of the current block and 32, and a height of thenon-zero region is determined as a smaller value between a height of thecurrent block and
 32. 3. The apparatus of claim 1, wherein, based onthat the transform kernels correspond to one of a plurality of transformcombinations of DST7 and/or DCT8, a width of the non-zero region isdetermined as a smaller value between a width of the current block and16 and a height of the non-zero region is determined as a smaller valuebetween a height of the current block and
 16. 4. The apparatus of claim1, wherein the processor is further configured to obtain a syntaxelement indicating a position of a last significant coefficient in scanorder within the current block, wherein the processor is configured toobtain coefficients to which the inverse transform is applied from thevideo signal based on the position of the last significant coefficient.5. The apparatus of claim 4, wherein the syntax element is binarizedaccording to a truncated unary method, and a maximum length of code forthe syntax element is determined based on a remaining region other thanthe non-zero region.
 6. An apparatus for encoding a video signal,comprising: a memory configured to store the video signal; and aprocessor coupled to the memory, wherein the processor is configured to:derive transform kernels being applied to a current block, wherein thetransform kernels include a horizontal transform kernel and a verticaltransform kernel; determine a non-zero region in which a transform isapplied to the current block based on the transform kernels and a widthand/or a height of the current block; and perform a transform on thecurrent block based on the transform kernels; generate a transform indexspecifying which transform kernels are applied along horizontal andvertical directions of the current block based on that a transform skipis not applied to the current block, wherein the transform kernelscorrespond to at least one of predefined transform types including DCT2,DST7 and DCT8; and generate a syntax element representing whether thetransform skip is applied to the current block.
 7. The apparatus ofclaim 6, wherein, based on that the transform kernels correspond toDCT2, a width of the non-zero region is determined as a smaller valuebetween the width of the current block and 32, and a height of thenon-zero region is determined as a smaller value between the height ofthe current block and
 32. 8. The apparatus of claim 6, wherein, based onthat the transform kernels correspond to one of a plurality of transformcombinations of DST7 and/or DCT8, a width of the non-zero region isdetermined as a smaller value between the width of the current block and16 and a height of the non-zero region is determined as a smaller valuebetween the height of the current block and
 16. 9. The apparatus ofclaim 6, wherein the processor is further configured to generate asyntax element indicating a position of a last significant coefficientin scan order within the current block.
 10. The apparatus of claim 9,wherein the syntax element is binarized according to a truncated unarymethod, and a maximum length of code for the syntax element isdetermined based on a remaining region other than the non-zero region.11. An apparatus for transmitting data for a video signal, comprising:at least one processor configured to obtain a bitstream for the videosignal; and a transmitter configured to transmit the data comprising thebitstream, wherein the at least one processor is configured to: derivetransform kernels being applied to a current block, wherein thetransform kernels include a horizontal transform kernel and a verticaltransform kernel; determine a non-zero region in which a transform isapplied to the current block based on the transform kernels and a widthand/or a height of the current block; and perform a transform on thecurrent block based on the transform kernels; generate a transform indexindicating which transform kernels are applied along horizontal andvertical directions of the current block based on that a transform skipis not applied to the current block, wherein the transform kernelscorrespond to at least one of predefined transform types including DCT2,DST7 and DCT8; and generate a syntax element representing whether thetransform skip is applied to the current block.